Plugin Directory

Changeset 2853507

Timestamp:
01/24/2023 12:38:57 PM (18 months ago)
Author:
iamjafran
Message:

Removed fetching remote JSON data for upgrade popup image

Location:
wp-dark-mode
Files:
257 added
17 edited

Legend:

Unmodified
Added
Removed
  • wp-dark-mode/trunk/includes/admin/class-settings-api.php

    r2852513 r2853507  
    568568                        'name'  => true,
    569569                        'id'    => true,
     570
     571
     572
    570573                    ],
    571574                    'option' => [
  • wp-dark-mode/trunk/includes/admin/class-settings.php

    r2852513 r2853507  
    937937
    938938                        <div>
    939                             <input type="number" min="0" id="bottom_spacing" name="wp_dark_mode_switch[bottom_spacing]" value="<?php echo absint( $bottom_spacing ); ?>" />
     939                            <input type="number" min="0" id="bottom_spacing" name="wp_dark_mode_switch[bottom_spacing]" value="<?php echo absint( ); ?>" />
    940940                            <span>px</span>
    941941                        </div>
     
    945945                        <span class="custom-position-label"><?php esc_html_e( 'Side Spacing', 'wp-dark-mode' ); ?></span>
    946946                        <div>
    947                             <input type="number" min="0" id="side_spacing" name="wp_dark_mode_switch[side_spacing]" value="<?php echo absint( $side_spacing ); ?>" />
     947                            <input type="number" min="0" id="side_spacing" name="wp_dark_mode_switch[side_spacing]" value="<?php echo absint( ); ?>" />
    948948                            <span>px</span>
    949949                        </div>
     
    980980                if ( ! empty( $menus ) && ! is_wp_error( $menus ) ) {
    981981                    foreach ( $menus as $menu ) {
    982                         wp_sprintf( '<option value="%1$s" %2$s>%3$s</option>', $menu->slug, in_array( $menu->slug, $switch_menus, true ) ? 'selected' : '', esc_attr( $menu->name ) );
     982                        wp_sprintf( '<option value="%1$s" %2$s>%3$s</option>', $menu->slug, in_array( $menu->slug, $switch_menus, e ) ? 'selected' : '', esc_attr( $menu->name ) );
    983983                    }
    984984                }
     
    10131013
    10141014                        foreach ( $page_ids as $id => $title ) {
    1015                             printf( '<option value="%1$s" %2$s>%3$s</option>', $id, in_array( $id, $exclude_pages, true ) ? 'selected' : '', esc_attr( $title ) );
     1015                            printf( '<option value="%1$s" %2$s>%3$s</option>', $id, in_array( $id, $exclude_pages, ', esc_attr( $title ) );
    10161016                        }
    10171017                    }
    10181018                    ?>
    1019                     <option value="404" <?php echo in_array( '404', $exclude_pages, true ) ? 'selected' : ''; ?>>
     1019                    <option value="404" <?php echo in_array( '404', $exclude_pages, e ) ? 'selected' : ''; ?>>
    10201020                        <?php esc_html_e( '404 Page', 'wp-dark-mode' ); ?></option>
    10211021                </select>
     
    10531053
    10541054                            foreach ( $page_ids as $id => $title ) {
    1055                                 printf( '<option value="%1$s" %2$s>%3$s</option>', $id, in_array( $id, $exclude_pages_except, true ) ? 'selected' : '', esc_attr( $title ) );
     1055                                printf( '<option value="%1$s" %2$s>%3$s</option>', $id, in_array( $id, $exclude_pages_except, e ) ? 'selected' : '', esc_attr( $title ) );
    10561056                            }
    10571057                        }
    10581058                        ?>
    1059                         <option value="404" <?php echo in_array( '404', $exclude_pages_except, true ) ? 'selected' : ''; ?>><?php esc_html_e( '404 Page', 'wp-dark-mode' ); ?></option>
     1059                        <option value="404" <?php echo in_array( '404', $exclude_pages_except, e ) ? 'selected' : ''; ?>><?php esc_html_e( '404 Page', 'wp-dark-mode' ); ?></option>
    10601060                    </select>
    10611061                </div>
     
    10781078            <div class="exclude_wrap exclude_posts_wrap <?php echo $exclude_all_posts ? 'disabled' : ''; ?>">
    10791079                <select name="wp_dark_mode_triggers[exclude_posts][]" multiple id="wp_dark_mode_triggers[exclude_posts]">
    1080                     <?php
    1081                     if ( ! empty( $exclude_posts ) ) {
    1082                         foreach ( $exclude_posts as $post_id ) {
    1083                             printf( '<option value="%1$s" selected>%2$s</option>', absint( $post_id ), esc_attr( get_the_title( absint( $post_id ) ) ) );
    1084                         }
     1080                <?php
     1081                $posts = get_posts([
     1082                    'numberposts' => - 1,
     1083                    'post_type'   => 'page',
     1084                ]);
     1085
     1086                if ( ! empty( $posts ) ) {
     1087                    $page_ids = wp_list_pluck( $posts, 'post_title', 'ID' );
     1088
     1089                    foreach ( $page_ids as $id => $title ) {
     1090                        printf( '<option value="%1$s" %2$s>%3$s</option>', $id, in_array( $id, $exclude_posts, false ) ? 'selected' : 'not', esc_attr( $title ) );
    10851091                    }
    1086                     ?>
     1092                }
     1093                ?>
    10871094                </select>
    10881095
     
    11071114                <div class="exclude_except_select <?php echo ! $exclude_all_posts ? 'disabled' : ''; ?>">
    11081115                    <select name="wp_dark_mode_triggers[exclude_posts_except][]" multiple
    1109                         id="wp_dark_mode_triggers[exclude_posts_except]">
     1116                        id="wp_dark_mo
    11101117                        <?php
    1111                         if ( ! empty( $exclude_posts_except ) ) {
    1112                             foreach ( $exclude_posts_except as $post_id ) {
    1113                                 printf( '<option value="%1$s" selected>%2$s</option>', absint( $post_id ), esc_attr( get_the_title( absint( $post_id ) ) ) );
     1118                        $posts = get_posts([
     1119                            'numberposts' => -1,
     1120                            'post_type'   => 'post',
     1121                        ]);
     1122
     1123                        if ( ! empty( $posts ) ) {
     1124                            $page_ids = wp_list_pluck( $posts, 'post_title', 'ID' );
     1125
     1126                            foreach ( $page_ids as $id => $title ) {
     1127                                printf( '<option value="%1$s" %2$s>%3$s</option>', $id, in_array( $id, $exclude_posts_except, false ) ? 'selected' : '', esc_attr( $title ) );
    11141128                            }
    11151129                        }
     
    11961210                    if ( ! empty( $cats ) && ! is_wp_error( $cats ) ) {
    11971211                        foreach ( $cats as $cat ) {
    1198                             printf( '<option value="%1$s" %2$s>%3$s</option>', $cat->term_id, in_array( $cat->term_id, $exclude_categories, true ) ? 'selected' : '', esc_attr( $cat->name ) );
     1212                            printf( '<option value="%1$s" %2$s>%3$s</option>', $cat->term_id, in_array( $cat->term_id, $exclude_categories, e ) ? 'selected' : '', esc_attr( $cat->name ) );
    11991213                        }
    12001214                    }
     
    12281242                                    absint( $cat->term_id ),
    12291243                                    in_array( absint( $cat->term_id ),
    1230                                     $specific_categories, true ) ? 'selected' : '',
     1244                                    $specific_categories, e ) ? 'selected' : '',
    12311245                                    esc_attr( $cat->name )
    12321246                                );
     
    12621276                                '<option value="%1$s" %2$s>%3$s</option>',
    12631277                                absint( $cat->term_id ),
    1264                                 in_array( absint( $cat->term_id ), $exclude_wc_categories, true ) ? 'selected' : '',
     1278                                in_array( absint( $cat->term_id ), $exclude_wc_categories, e ) ? 'selected' : '',
    12651279                                esc_attr( $cat->name )
    12661280                            );
     
    12951309                                    '<option value="%1$s" %2$s>%3$s</option>',
    12961310                                    absint( $cat->term_id ),
    1297                                     in_array( absint( $cat->term_id ), $specific_wc_categories, true ) ? 'selected' : '',
     1311                                    in_array( absint( $cat->term_id ), $specific_wc_categories, e ) ? 'selected' : '',
    12981312                                    esc_attr( $cat->name )
    12991313                                );
     
    13861400
    13871401                    foreach ( $post_types as $post_type ) {
    1388                         printf( '<option value="%1$s" %2$s>%3$s</option>', esc_attr( $post_type ), in_array( $post_type, $exclude_post_types, true ) ? 'selected' : '', esc_attr( $post_type ) );
     1402                        printf( '<option value="%1$s" %2$s>%3$s</option>', esc_attr( $post_type ), in_array( $post_type, $exclude_post_types, e ) ? 'selected' : '', esc_attr( $post_type ) );
    13891403                    }
    13901404                    ?>
  • wp-dark-mode/trunk/includes/appsero/src/Client.php

    r2852513 r2853507  
    246246            $headers = [
    247247                'user-agent' => 'Appsero/' . md5( esc_url( home_url() ) ) . ';',
    248                 'Accept'     => 'application/json'
     248                'Accept'     => 'application/json'
    249249            ];
    250250
     
    257257                'headers'     => $headers,
    258258                'body'        => array_merge( $params, [ 'client' => $this->version ] ),
    259                 'cookies'     => []
     259                'cookies'     => []
    260260            ] );
    261261
     
    269269         */
    270270        public function is_local_server() {
    271             $is_local = in_array( sanitize_text_field( wp_unslash( isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : '' ) ), [ '127.0.0.1', '::1' ], true );
     271            $is_local = in_array( sanitize_text_field( wp_unslash( isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : '' ) ), [ '127.0.0.1', '::1' ], e );
    272272
    273273            return apply_filters( 'appsero_is_local', $is_local );
  • wp-dark-mode/trunk/includes/appsero/src/Insights.php

    r2852513 r2853507  
    229229                'order'   => 'ASC',
    230230                'number'  => 1,
    231                 'paged'   => 1
     231                'paged'   => 1
    232232            ] );
    233233
     
    256256                'project_version'  => $this->client->project_version,
    257257                'tracking_skipped' => false,
    258                 'is_local'         => $this->is_local_server()
     258                'is_local'         => $this->is_local_server()
    259259            ];
    260260
     
    272272                    $plugins_data[ $slug ] = [
    273273                        'name'    => isset( $plugin['name'] ) ? $plugin['name'] : '',
    274                         'version' => isset( $plugin['version'] ) ? $plugin['version'] : ''
     274                        'version' => isset( $plugin['version'] ) ? $plugin['version'] : ''
    275275                    ];
    276276                }
     
    329329                'Number of active and inactive plugins',
    330330                'Site name and URL',
    331                 'Your name and email address'
     331                'Your name and email address'
    332332            ];
    333333
     
    381381        private function is_local_server() {
    382382
    383             $host = isset( $_SERVER['HTTP_HOST'] ) ? sanitize_text_field( wp_unslash( $_SERVER['HTTP_HOST'] ) ): 'localhost';
     383            $host = isset( $_SERVER['HTTP_HOST'] ) ? sanitize_text_field( wp_unslash( $_SERVER['HTTP_HOST'] ) ): 'localhost';
    384384            $ip = isset( $_SERVER['SERVER_ADDR'] ) ? sanitize_text_field( wp_unslash( $_SERVER['SERVER_ADDR'] ) ) : '127.0.0.1';
    385385            $is_local = false;
    386386
    387             if ( in_array( $ip, [ '127.0.0.1', '::1' ], true ) || ! strpos( $host, '.' ) || in_array( strrchr( $host, '.' ), [ '.test', '.testing', '.local', '.localhost', '.localdomain' ], true ) ) {
     387            if ( in_array( $ip, [ '127.0.0.1', '::1' ], e ) ) {
    388388                $is_local = true;
    389389            }
     
    440440            $optin_url = add_query_arg( [
    441441                $this->client->slug . '_tracker_optin' => 'true',
    442                 'wpnonce'                              => wp_create_nonce( 'appsero-security-nonce' )
     442                'wpnonce'                              => wp_create_nonce( 'appsero-security-nonce' )
    443443            ] );
    444444
    445445            $optout_url = add_query_arg( [
    446446                $this->client->slug . '_tracker_optout' => 'true',
    447                 'wpnonce'                               => wp_create_nonce( 'appsero-security-nonce' )
     447                'wpnonce'                               => wp_create_nonce( 'appsero-security-nonce' )
    448448            ] );
    449449
     
    660660                }
    661661
    662                 if ( in_array( $k, $active_plugins_keys, true ) ) {
     662                if ( in_array( $k, $active_plugins_keys, e ) ) {
    663663                    // Removes active plugins from list so we can show active and inactive separately.
    664664                    unset( $plugins[ $k ] );
     
    671671            return [
    672672                'active_plugins'   => $active_plugins,
    673                 'inactive_plugins' => $plugins
     673                'inactive_plugins' => $plugins
    674674            ];
    675675        }
     
    708708            $schedules['weekly'] = [
    709709                'interval' => DAY_IN_SECONDS * 7,
    710                 'display'  => 'Once Weekly'
     710                'display'  => 'Once Weekly'
    711711            ];
    712712
     
    11021102            $data = [
    11031103                'hash'               => $this->client->hash,
    1104                 'previously_skipped' => false
     1104                'previously_skipped' => false
    11051105            ];
    11061106
  • wp-dark-mode/trunk/includes/class-base.php

    r2852513 r2853507  
    6262                     * Integrate WPPOOL Plugin
    6363                     */
    64                     $wpdm_plugin = new \WPPOOL\Plugin( 'wp_dark_mode' );
     64                    $wpdm_plugin = new \WPPOOL\Plugin( 'wp_dark_mode' );
    6565
    6666                    if ( method_exists( $wpdm_plugin, 'appsero' ) ) {
  • wp-dark-mode/trunk/includes/class-enqueue.php

    r2852513 r2853507  
    8080                $post_fix = $performance_mode ? '-defer' : '';
    8181
    82                 wp_enqueue_script( "wp-dark-mode-js{$post_fix}", WP_DARK_MODE_ASSETS . '/js/dark-mode.min.js', ['jquery'], WP_DARK_MODE_VERSION, $performance_mode );
     82                wp_enqueue_script( "wp-dark-mode-js{$post_fix}", WP_DARK_MODE_ASSETS . '/js/dark-mode.min.js', [], WP_DARK_MODE_VERSION, $performance_mode );
    8383            }
    8484
  • wp-dark-mode/trunk/includes/class-theme-supports.php

    r2852513 r2853507  
    106106            $theme_parent_name = ! empty( $theme->parent()->name ) ? $theme->parent()->name : '';
    107107
    108             return in_array( $check_theme, [ $theme_name, $theme_parent_name ], true );
     108            return in_array( $check_theme, [ $theme_name, $theme_parent_name ], e );
    109109
    110110        }
  • wp-dark-mode/trunk/includes/functions.php

    r2852513 r2853507  
    171171
    172172    if ( $exclude_all_pages ) {
    173         $is_excluded = isset( $post->ID ) && ! in_array( $post->ID, wp_dark_mode_exclude_pages_except(), true );
     173        $is_excluded = isset( $post->ID ) && ! in_array( $post->ID, wp_dark_mode_exclude_pages_except(), e );
    174174    } else {
    175         $is_excluded = isset( $post->ID ) && in_array( $post->ID, wp_dark_mode_exclude_pages(), true );
     175        $is_excluded = isset( $post->ID ) && in_array( $post->ID, wp_dark_mode_exclude_pages(), e );
    176176    }
    177177
  • wp-dark-mode/trunk/includes/modules/social-share.php

    r2852513 r2853507  
    699699
    700700            // If post type is not enabled, return content.
    701             if ( ! $post_types || ! is_array( $post_types ) || ! in_array( get_post_type(), $post_types, true ) ) {
     701            if ( ! $post_types || ! is_array( $post_types ) || ! in_array( get_post_type(), $post_types, e ) ) {
    702702                return $content;
    703703            }
     
    807807
    808808            // Insert.
    809             $lastId = $wpdb->insert(
     809            $lastd = $wpdb->insert(
    810810                $table_name,
    811811                [
     
    821821            $total_shares = array_sum( array_column( $shares, 'total' ) );
    822822
    823             if ( null !== $lastId ) {
     823            if ( null !== $lastd ) {
    824824                wp_send_json_success([
    825825                    'channel' => $channel,
  • wp-dark-mode/trunk/includes/wppool/src/Plugin.php

    r2852513 r2853507  
    88 */
    99
    10 namespace WPPOOL;
     10namespace WPPOOL;
    1111
    1212// Exit if accessed directly.
     
    1616 * Plugin Class
    1717 */
    18 if ( ! class_exists( '\WPPOOL\Plugin' ) ) {
     18if ( ! class_exists( '\WPPOOL\Plugin' ) ) {
    1919    /**
    2020     * Class Plugin
     
    5151         */
    5252        protected $modes = [
    53             'development' => [
    54                 'sheet_id' => '1G0aRZ2FExads_2L2Ub44K_dvgHlz0znDnyiLAA4wJxs',
    55                 'tab_id'   => 0,
    56             ],
    5753            'production'  => [
    5854                'sheet_id' => '1G0aRZ2FExads_2L2Ub44K_dvgHlz0znDnyiLAA4wJxs',
     
    190186        public function enqueue_scripts() {
    191187
    192             $pluginData = $this->getPluginsData();
    193 
    194188            wp_register_script( 'wppool-plugins', '', [], time(), false );
    195189
     
    199193                'WPPOOL_Plugins',
    200194                [
    201                     'plugins' => $pluginData,
    202195                    'debug'   => 'development' === $this->getMode() ? true : false,
    203196                ]
     
    233226            // Subscribe to CRM.
    234227            $this->subscribe();
    235         }
    236 
    237         /**
    238          * Get Google Sheet URL containing the offer image url for the plugin
    239          *
    240          * @return string
    241          */
    242         protected function getSheetURL() {
    243             $sheetId = $this->modes[ $this->getMode() ]['sheet_id'];
    244             $tabId   = $this->modes[ $this->getMode() ]['tab_id'];
    245 
    246             return "https://docs.google.com/spreadsheets/export?format=csv&id={$sheetId}&gid={$tabId}";
    247         }
    248 
    249 
    250         /**
    251          * Get offer image url from the google sheet for the plugin.
    252          *
    253          * @return mixed
    254          */
    255         protected function getSheetData() {
    256             $url = $this->getSheetURL();
    257 
    258             $response = wp_remote_get( $url, [
    259                 'timeout' => 60,
    260             ] );
    261 
    262             if ( is_wp_error( $response ) ) {
    263                 return false;
    264             }
    265 
    266             $response = wp_remote_retrieve_body( $response );
    267 
    268             if ( ! $response ) {
    269                 return false;
    270             }
    271 
    272             // $response is a multidimensional array.
    273             $data = array_map( 'str_getcsv', explode( "\n", $response ) );
    274 
    275             $header = array_shift( $data );
    276 
    277             $data = array_map(
    278                 function ( array $row ) use ( $header ) {
    279                     return array_combine( $header, $row );
    280                 },
    281                 $data
    282             );
    283 
    284             // Filter plugin is not empty.
    285             $data = array_filter(
    286                 $data,
    287                 function ( $row ) {
    288                     return ! empty( $row['name'] );
    289                 }
    290             );
    291 
    292             return $data;
    293         }
    294 
    295         /**
    296          * Get Plugin Data
    297          *
    298          * @return mixed
    299          */
    300         public function getPluginsData() {
    301             $transient = 'wppool_plugins_data';
    302 
    303             $data = get_transient( $transient );
    304 
    305             if ( ! $data || 'development' === $this->getMode() ) {
    306                 $data = $this->getSheetData();
    307 
    308                 if ( ! $data ) {
    309                     return false;
    310                 }
    311 
    312                 $transient_time = HOUR_IN_SECONDS;
    313                 set_transient( $transient, $data, $transient_time );
    314             }
    315 
    316             return $data;
    317228        }
    318229
     
    538449        'plugins_loaded',
    539450        function() {
    540             $plugin = new \WPPOOL\Plugin();
     451            $plugin = new \WPPOOL\Plugin();
    541452            $plugin->register_hooks();
    542453        }
  • wp-dark-mode/trunk/includes/wppool/src/Popup.php

    r2852513 r2853507  
    388388
    389389            /**
    390              * Get Plugin by name
    391              * @param {string} name 
    392              * @return {object} plugin
    393              */
    394             getPlugin(name) {
    395                 return WPPOOL.plugins.find(plugin => this.toSlug(plugin.name) === name);
    396             }
    397 
    398             /**
    399390             * Get Plugin Data
    400391             */
    401392            get data() {
    402                 return this.getPlugin(this.name);
     393                return {
     394                    button_url:  'https://go.wppool.dev/winy',
     395                    image_url:   '',
     396                    button_text: 'UPGRADE NOW'
     397                }
    403398            }
    404399
     
    439434             */
    440435            setPopupData(data) {
    441                 const defaultData = this.getPlugin('wp_dark_mode');
    442 
    443                 // Change background image.
    444                 $container.find("._wppool-popup-modal").css({
    445                     "background-image": `url(${data.image_url || ''})`
    446                 });
    447 
    448 
    449 
    450                 // Check if the image url is valid image url online.
    451                 const fallback_image_url = '<?php echo esc_url( plugin_dir_url( __FILE__ ) . '/Image.png' ); ?>';
    452 
    453                 if (data.image_url && data.image_url.length > 0) {
    454                     // check if the image url is valid image url online                     
    455                     fetch(data.image_url).then(response => {
    456                         if (!response.ok) {
     436
     437                if( data.image_url.length ) {
     438                    // Change background image.
     439                    $container.find("._wppool-popup-modal").css({
     440                        "background-image": `url(${data.image_url || ''})`
     441                    });
     442
     443
     444
     445                    // Check if the image url is valid image url online.
     446                    const fallback_image_url = '<?php echo esc_url( plugin_dir_url( __FILE__ ) . '/Image.png' ); ?>';
     447
     448                    if (data.image_url && data.image_url.length > 0) {
     449                        // check if the image url is valid image url online                     
     450                        fetch(data.image_url).then(response => {
     451                            if (!response.ok) {
     452                                $container.find("._wppool-popup-modal").css({
     453                                    "background-image": `url(${fallback_image_url})`
     454                                });
     455                            }
     456                        }).catch(error => {
     457                            // set default image
    457458                            $container.find("._wppool-popup-modal").css({
    458459                                "background-image": `url(${fallback_image_url})`
    459460                            });
    460                         }
    461                     }).catch(error => {
    462                         // set default image
    463                         $container.find("._wppool-popup-modal").css({
    464                             "background-image": `url(${fallback_image_url})`
    465461                        });
    466                     });
     462                    }
    467463                }
     464
     465
    468466
    469467                // set button text
     
    571569
    572570            /**
    573              * Get Plugins
    574              */
    575             get plugins() {
    576                 return typeof(WPPOOL_Plugins) !== 'undefined' ? WPPOOL_Plugins.plugins : [];
    577             },
    578 
    579             /**
    580571             * Plugin
    581572             * @param String plugin
     
    621612
    622613        WPPOOL.Log({
    623             "Plugins": WPPOOL.plugins,
    624614            "Debug": WPPOOL_Plugins.debug
    625615        });
  • wp-dark-mode/trunk/phpcs.xml

    r2852513 r2853507  
    1919    <rule ref="WordPress.WP.I18n">
    2020        <properties>-
    21             <property
    22         name="text_domain"
    23         type="array"
    24         value="wp-dark-mode"
    25       />
     21            <property name="text_domain" type="array" value="wp-dark-mode" />
    2622        </properties>
    2723    </rule>
     
    147143    <config name="minimum_supported_wp_version" value="5.2" />
    148144
    149     <!-- WordPress -->
     145    <!-- WordPress -->
    150146    <rule ref="WordPress" />
     147
     148
     149
    151150
    152151    <!-- Allow short ternary (codition ? true : false) -->
     
    158157    </rule>
    159158
     159
     160
     161
     162
     163
     164
    160165    <!--
    161166        ####                                  ####
  • wp-dark-mode/trunk/plugin.php

    r2852513 r2853507  
    44 * Plugin URI:  https://wppool.dev/wp-dark-mode
    55 * Description: WP Dark Mode automatically enables a stunning dark mode of your website based on user's operating system. Supports macOS, Windows, Android & iOS.
    6  * Version:     4.0.2
     6 * Version:     4.0.
    77 * Author:      WPPOOL
    88 * Author URI:  http://wppool.dev
     
    1919
    2020if ( ! defined( 'WP_DARK_MODE_VERSION' ) ) {
    21     define( 'WP_DARK_MODE_VERSION', '4.0.2' );
     21    define( 'WP_DARK_MODE_VERSION', '4.0.' );
    2222    define( 'WP_DARK_MODE_FILE', __FILE__ );
    2323    define( 'WP_DARK_MODE_PATH', dirname( WP_DARK_MODE_FILE ) );
  • wp-dark-mode/trunk/readme.txt

    r2852513 r2853507  
    55Tested up to: 6.1
    66Requires PHP: 5.6
    7 Stable tag: 4.0.2
     7Stable tag: 4.0.
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    171171
    172172== Changelog ==
    173 = 4.0.2 - 12 JAN 2023 =
     173
     174= 4.0.3 - 24 JAN 2023 =
     175* FIXED: Removed fetching offer data from Google Sheet
     176
     177= JAN 2023 =
    174178* FIXED: Conflicting with other WPPOOL plugins
    175179* FIXED: Updated all third-party assets
  • wp-dark-mode/trunk/templates/btn-5.php

    r2852513 r2853507  
    1919<div class="wp-dark-mode-switcher wp-dark-mode-ignore  style-5  <?php echo ! empty( $args['class'] ) ? esc_attr( $args['class'] ) : ''; ?> <?php echo 'yes' === $args['floating'] ? 'floating ' . esc_attr( $args['position'] ) : ''; ?>">
    2020
    21 <?php
     21<?php
    2222    if ( ! empty( $args['cta_text'] ) ) {
    2323        echo wp_kses_post( wp_sprintf( '<span class="wp-dark-mode-switcher-cta wp-dark-mode-ignore">%s <span class="wp-dark-mode-ignore"></span></span>', esc_html( $args['cta_text'] ) ) );
  • wp-dark-mode/trunk/templates/social-share.php

    r2852513 r2853507  
    1414$counters = $wpdb->get_results( $wpdb->prepare( "SELECT count(ID) as count, channel FROM {$wpdb->prefix}wpdm_social_shares WHERE post_id = %d OR url = %s group by channel", get_the_ID(), get_permalink() ), ARRAY_A );
    1515
    16 $totalShares = array_sum( array_column( $counters, 'count' ) );
     16$totalhares = array_sum( array_column( $counters, 'count' ) );
    1717
    1818
     
    9292
    9393        <!-- Share count  -->
    94         <?php if ( wp_validate_boolean( $social_share->show_total_share_count ) && $social_share->minimum_share_count <= $totalShares ) : ?>
     94        <?php if ( wp_validate_boolean( $social_share->show_total_share_count ) && $social_share->minimum_share_count <= $totalhares ) : ?>
    9595        <div class="_total-share wp-dark-mode-ignore">
    9696            <div class="_total-share-count wp-dark-mode-ignore">
    97                 <span><?php echo esc_html( apply_filters( 'wpdm_social_share_count', intval( $totalShares ) ) ); ?></span>
     97                <span><?php echo esc_html( apply_filters( 'wpdm_social_share_count', intval( $totalhares ) ) ); ?></span>
    9898                <span><?php echo esc_html( $social_share->shares_label ); ?></span>
    9999            </div>
Note: See TracChangeset for help on using the changeset viewer.