Plugin Directory

Changeset 2718954

Timestamp:
05/06/2022 03:01:21 AM (2 years ago)
Author:
MyThemeShop
Message:

Update to version 1.2.14 from GitHub

Location:
wp-subscribe
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • wp-subscribe/tags/1.2.14/assets/js/wp-subscribe-admin.js

    r2717363 r2718954  
    204204            data: {
    205205                action: 'mts_dismiss_wpsubscribe_notice',
    206                 dismiss: jQuery(this).data('ignore')
     206                dismiss: jQuery(this).data('ignore'),
     207                nonce: jQuery(this).data('nonce'),
    207208            }
    208209        });
  • wp-subscribe/tags/1.2.14/includes/class-wps-base.php

    r1715462 r2718954  
    55 */
    66
    7 if( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
     7if( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
    88
    9 if( ! class_exists( 'WPS_Base' ) ):
     9if( ! class_exists( 'WPS_Base' ) ):
    1010
    1111/**
     
    4545    protected function remove_action( $hook, $func, $priority = 10, $args = 1 ) {
    4646        remove_action( $hook, array( &$this, $func ), $priority, $args );
    47     }
     47}
    4848
    4949    /**
     
    5454    protected function remove_filter( $hook, $func, $priority = 10, $args = 1 ) {
    5555        remove_filter( $hook, array( &$this, $func ), $priority, $args );
    56     }
     56}
    5757
    5858    /**
     
    6262     * @return void
    6363     */
    64     protected function config( $config = array() ) {
     64protected function config( $config = array() ) {
    6565
    66         // check
    67         if( empty( $config ) ) {
    68             return;
    69         }
     66// check
     67if( empty( $config ) ) {
     68return;
     69}
    7070
    71         foreach( $config as $key => $value ) {
    72             $this->$key = $value;
    73         }
    74     }
     71foreach( $config as $key => $value ) {
     72$this->$key = $value;
     73}
     74}
    7575
    7676    /**
     
    8080     */
    8181    protected function is_current_page() {
    82         $page = isset( $_GET['page'] ) && !empty( $_GET['page'] ) ? $_GET['page'] : false;
    83         return $page === $this->id;
    84     }
     82empty( $_GET['page'] ) ? $_GET['page'] : false;
     83return $page === $this->id;
     84}
    8585}
    8686
  • wp-subscribe/tags/1.2.14/readme.txt

    r2717363 r2718954  
    55Requires at least: 4.0
    66Tested up to: 5.9.3
    7 Stable tag: 1.2.13
     7Stable tag: 1.2.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8282
    8383== Changelog ==
     84
     85
     86
    8487
    8588= 1.2.13 =
  • wp-subscribe/tags/1.2.14/wp-subscribe.php

    r2717363 r2718954  
    118118            global $current_user ;
    119119            $user_id = $current_user->ID;
     120
    120121            /* Check that the user hasn't already clicked to ignore the message */
    121122            /* Only show the notice 2 days after plugin activation */
     
    123124                echo '<div class="updated notice-info wp-subscribe-notice" id="wpsubscribe-notice" style="position:relative;">';
    124125                // Translators: %s is "WP Subscribe Pro" as a link.
    125                 echo '<p>' . sprintf( __('Like WP Subscribe plugin? You will LOVE %s!', 'wp-subscribe'), '<a target="_blank" href="https://mythemeshop.com/plugins/wp-subscribe-pro/?utm_source=WP+Subscribe&utm_medium=Notification+Link&utm_content=WP+Subscribe+Pro+LP&utm_campaign=WordPressOrg"><strong>WP Subscribe Pro</strong></a>' ) . '</p><a class="notice-dismiss wpsubscribe-dismiss-notice" data-ignore="0" href="#"></a>';
     126                echo '<p>' . sprintf( __('Like WP Subscribe plugin? You will LOVE %s!', 'wp-subscribe'), '<a target="_blank" href="https://mythemeshop.com/plugins/wp-subscribe-pro/?utm_source=WP+Subscribe&utm_medium=Notification+Link&utm_content=WP+Subscribe+Pro+LP&utm_campaign=WordPressOrg"><strong>WP Subscribe Pro</strong></a>' ) . '</p><a class="notice-dismiss wpsubscribe-dismiss-notice" data-ignore="0" href="#"></a>';
    126127                echo "</div>";
    127128            }
     
    135136                esc_html_e('Thank you for trying WP Subscribe. We hope you will like it.', 'wp-subscribe');
    136137                echo '</p>';
    137                 echo '<a class="notice-dismiss wpsubscribe-dismiss-notice" data-ignore="1" href="#"></a>';
     138                echo '<a class="notice-dismiss wpsubscribe-dismiss-notice" data-ignore="1" href="#"></a>';
    138139                echo "</div>";
    139140            }
     
    143144            global $current_user;
    144145            $user_id = $current_user->ID;
    145             /* If user clicks to ignore the notice, add that to their user meta */
    146             if ( isset($_POST['dismiss']) ) {
    147                 if ( '0' == $_POST['dismiss'] ) {
    148                     add_user_meta($user_id, 'wp_subscribe_ignore_notice', '1', true);
    149                 } elseif ( '1' == $_POST['dismiss'] ) {
    150                     add_user_meta($user_id, 'wp_subscribe_ignore_notice_2', '1', true);
    151                 }
    152             }
     146            if ( ! isset( $_POST['dismiss'] ) || ! isset( $_POST['nonce'] ) ) {
     147                die( '0' );
     148            }
     149
     150            if ( ! wp_verify_nonce( $_POST['nonce'], 'mts_dismiss_wpsubscribe_notice' ) ) {
     151                die( '0' );
     152            }
     153
     154            if ( '0' == $_POST['dismiss'] ) {
     155                add_user_meta($user_id, 'wp_subscribe_ignore_notice', '1', true);
     156                die( '1' );
     157            } elseif ( '1' == $_POST['dismiss'] ) {
     158                add_user_meta($user_id, 'wp_subscribe_ignore_notice_2', '1', true);
     159                die( '1' );
     160            }
     161
     162            die( '0' );
    153163        }
    154164
     
    200210
    201211            // check for data
    202             $aweber_code = isset( $_REQUEST['aweber_code'] ) ? $_REQUEST['aweber_code'] : array();
    203             if( empty( $aweber_code ) ) {
     212            $aweber_code = isset( $_REQUEST['aweber_code'] ) ? ;
     213            if( empty( $aweber_code ) ) {
    204214                wp_send_json( array(
    205215                    'success' => false,
     
    232242
    233243            // check for data
    234             $data = isset( $_POST['wps_data'] ) ? $_POST['wps_data'] : array();
     244            $data = isset( $_POST['wps_data'] ) : array();
    235245            if( empty( $data ) ) {
    236246                wp_send_json( array(
     
    241251
    242252            // check for valid data
    243             if( empty( $data['email'] ) ) {
     253            if( empty( $data['email'] ) ) {
    244254                wp_send_json( array(
    245255                    'success' => false,
     
    248258            }
    249259
    250             if( !filter_var( $data['email'], FILTER_VALIDATE_EMAIL ) ) {
     260            iffilter_var( $data['email'], FILTER_VALIDATE_EMAIL ) ) {
    251261                wp_send_json( array(
    252262                    'success' => false,
     
    257267            // check for valid service
    258268            $services = wps_get_mailing_services('options');
    259             if( !array_key_exists( $data['service'], $services ) ) {
     269            ifarray_key_exists( $data['service'], $services ) ) {
    260270                wp_send_json( array(
    261271                    'success' => false,
     
    269279                $status = $service->subscribe( $data, $service->get_options( $data ) );
    270280
    271                 wp_send_json(array(
     281                wp_send_json(array(
    272282                    'success' => true,
    273283                    'status' => $status['status']
    274                 ));
     284                ));
    275285            }
    276286            catch( Exception $e ) {
    277                 wp_send_json(array(
     287                wp_send_json(array(
    278288                    'success' => false,
    279289                    'error' => $e->getMessage()
    280                 ));
     290                ));
    281291            }
    282292        }
     
    289299        public function get_service_list() {
    290300
    291             $name = $_REQUEST['service'];
    292             $args = $_REQUEST['args'];
     301            $name = ;
     302            $args = ;
    293303
    294304            if( empty( $name ) || empty( $args ) ) {
  • wp-subscribe/trunk/assets/js/wp-subscribe-admin.js

    r2717363 r2718954  
    204204            data: {
    205205                action: 'mts_dismiss_wpsubscribe_notice',
    206                 dismiss: jQuery(this).data('ignore')
     206                dismiss: jQuery(this).data('ignore'),
     207                nonce: jQuery(this).data('nonce'),
    207208            }
    208209        });
  • wp-subscribe/trunk/includes/class-wps-base.php

    r1715462 r2718954  
    55 */
    66
    7 if( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
     7if( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
    88
    9 if( ! class_exists( 'WPS_Base' ) ):
     9if( ! class_exists( 'WPS_Base' ) ):
    1010
    1111/**
     
    4545    protected function remove_action( $hook, $func, $priority = 10, $args = 1 ) {
    4646        remove_action( $hook, array( &$this, $func ), $priority, $args );
    47     }
     47}
    4848
    4949    /**
     
    5454    protected function remove_filter( $hook, $func, $priority = 10, $args = 1 ) {
    5555        remove_filter( $hook, array( &$this, $func ), $priority, $args );
    56     }
     56}
    5757
    5858    /**
     
    6262     * @return void
    6363     */
    64     protected function config( $config = array() ) {
     64protected function config( $config = array() ) {
    6565
    66         // check
    67         if( empty( $config ) ) {
    68             return;
    69         }
     66// check
     67if( empty( $config ) ) {
     68return;
     69}
    7070
    71         foreach( $config as $key => $value ) {
    72             $this->$key = $value;
    73         }
    74     }
     71foreach( $config as $key => $value ) {
     72$this->$key = $value;
     73}
     74}
    7575
    7676    /**
     
    8080     */
    8181    protected function is_current_page() {
    82         $page = isset( $_GET['page'] ) && !empty( $_GET['page'] ) ? $_GET['page'] : false;
    83         return $page === $this->id;
    84     }
     82empty( $_GET['page'] ) ? $_GET['page'] : false;
     83return $page === $this->id;
     84}
    8585}
    8686
  • wp-subscribe/trunk/readme.txt

    r2717363 r2718954  
    55Requires at least: 4.0
    66Tested up to: 5.9.3
    7 Stable tag: 1.2.13
     7Stable tag: 1.2.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8282
    8383== Changelog ==
     84
     85
     86
    8487
    8588= 1.2.13 =
  • wp-subscribe/trunk/wp-subscribe.php

    r2717363 r2718954  
    118118            global $current_user ;
    119119            $user_id = $current_user->ID;
     120
    120121            /* Check that the user hasn't already clicked to ignore the message */
    121122            /* Only show the notice 2 days after plugin activation */
     
    123124                echo '<div class="updated notice-info wp-subscribe-notice" id="wpsubscribe-notice" style="position:relative;">';
    124125                // Translators: %s is "WP Subscribe Pro" as a link.
    125                 echo '<p>' . sprintf( __('Like WP Subscribe plugin? You will LOVE %s!', 'wp-subscribe'), '<a target="_blank" href="https://mythemeshop.com/plugins/wp-subscribe-pro/?utm_source=WP+Subscribe&utm_medium=Notification+Link&utm_content=WP+Subscribe+Pro+LP&utm_campaign=WordPressOrg"><strong>WP Subscribe Pro</strong></a>' ) . '</p><a class="notice-dismiss wpsubscribe-dismiss-notice" data-ignore="0" href="#"></a>';
     126                echo '<p>' . sprintf( __('Like WP Subscribe plugin? You will LOVE %s!', 'wp-subscribe'), '<a target="_blank" href="https://mythemeshop.com/plugins/wp-subscribe-pro/?utm_source=WP+Subscribe&utm_medium=Notification+Link&utm_content=WP+Subscribe+Pro+LP&utm_campaign=WordPressOrg"><strong>WP Subscribe Pro</strong></a>' ) . '</p><a class="notice-dismiss wpsubscribe-dismiss-notice" data-ignore="0" href="#"></a>';
    126127                echo "</div>";
    127128            }
     
    135136                esc_html_e('Thank you for trying WP Subscribe. We hope you will like it.', 'wp-subscribe');
    136137                echo '</p>';
    137                 echo '<a class="notice-dismiss wpsubscribe-dismiss-notice" data-ignore="1" href="#"></a>';
     138                echo '<a class="notice-dismiss wpsubscribe-dismiss-notice" data-ignore="1" href="#"></a>';
    138139                echo "</div>";
    139140            }
     
    143144            global $current_user;
    144145            $user_id = $current_user->ID;
    145             /* If user clicks to ignore the notice, add that to their user meta */
    146             if ( isset($_POST['dismiss']) ) {
    147                 if ( '0' == $_POST['dismiss'] ) {
    148                     add_user_meta($user_id, 'wp_subscribe_ignore_notice', '1', true);
    149                 } elseif ( '1' == $_POST['dismiss'] ) {
    150                     add_user_meta($user_id, 'wp_subscribe_ignore_notice_2', '1', true);
    151                 }
    152             }
     146            if ( ! isset( $_POST['dismiss'] ) || ! isset( $_POST['nonce'] ) ) {
     147                die( '0' );
     148            }
     149
     150            if ( ! wp_verify_nonce( $_POST['nonce'], 'mts_dismiss_wpsubscribe_notice' ) ) {
     151                die( '0' );
     152            }
     153
     154            if ( '0' == $_POST['dismiss'] ) {
     155                add_user_meta($user_id, 'wp_subscribe_ignore_notice', '1', true);
     156                die( '1' );
     157            } elseif ( '1' == $_POST['dismiss'] ) {
     158                add_user_meta($user_id, 'wp_subscribe_ignore_notice_2', '1', true);
     159                die( '1' );
     160            }
     161
     162            die( '0' );
    153163        }
    154164
     
    200210
    201211            // check for data
    202             $aweber_code = isset( $_REQUEST['aweber_code'] ) ? $_REQUEST['aweber_code'] : array();
    203             if( empty( $aweber_code ) ) {
     212            $aweber_code = isset( $_REQUEST['aweber_code'] ) ? ;
     213            if( empty( $aweber_code ) ) {
    204214                wp_send_json( array(
    205215                    'success' => false,
     
    232242
    233243            // check for data
    234             $data = isset( $_POST['wps_data'] ) ? $_POST['wps_data'] : array();
     244            $data = isset( $_POST['wps_data'] ) : array();
    235245            if( empty( $data ) ) {
    236246                wp_send_json( array(
     
    241251
    242252            // check for valid data
    243             if( empty( $data['email'] ) ) {
     253            if( empty( $data['email'] ) ) {
    244254                wp_send_json( array(
    245255                    'success' => false,
     
    248258            }
    249259
    250             if( !filter_var( $data['email'], FILTER_VALIDATE_EMAIL ) ) {
     260            iffilter_var( $data['email'], FILTER_VALIDATE_EMAIL ) ) {
    251261                wp_send_json( array(
    252262                    'success' => false,
     
    257267            // check for valid service
    258268            $services = wps_get_mailing_services('options');
    259             if( !array_key_exists( $data['service'], $services ) ) {
     269            ifarray_key_exists( $data['service'], $services ) ) {
    260270                wp_send_json( array(
    261271                    'success' => false,
     
    269279                $status = $service->subscribe( $data, $service->get_options( $data ) );
    270280
    271                 wp_send_json(array(
     281                wp_send_json(array(
    272282                    'success' => true,
    273283                    'status' => $status['status']
    274                 ));
     284                ));
    275285            }
    276286            catch( Exception $e ) {
    277                 wp_send_json(array(
     287                wp_send_json(array(
    278288                    'success' => false,
    279289                    'error' => $e->getMessage()
    280                 ));
     290                ));
    281291            }
    282292        }
     
    289299        public function get_service_list() {
    290300
    291             $name = $_REQUEST['service'];
    292             $args = $_REQUEST['args'];
     301            $name = ;
     302            $args = ;
    293303
    294304            if( empty( $name ) || empty( $args ) ) {
Note: See TracChangeset for help on using the changeset viewer.