Plugin Directory

Changeset 2874094


Ignore:
Timestamp:
03/03/2023 06:38:10 AM (3 years ago)
Author:
themebeez
Message:

Update to version 1.1.1 from GitHub

Location:
universal-google-adsense-and-ads-manager
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • universal-google-adsense-and-ads-manager/tags/1.1.1/README.txt

    r2867532 r2874094  
    66Tested up to: 6.1.1
    77Requires PHP: 7.0.0
    8 Stable tag: 1.1.0
     8Stable tag: 1.1.1
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    174174== Changelog ==
    175175
     176= 1.1.1 - 03 March, 2023 =
     177
     178- Updated: UDP version to 1.0.1.
     179
    176180= 1.1.0 - 19 February, 2023 =
    177181
  • universal-google-adsense-and-ads-manager/tags/1.1.1/includes/udp/class-udp-agent.php

    r2867532 r2874094  
    55 * @link       https://creamcode.org/user-data-processing/
    66 * @since      1.0.0
    7  * @author     Cream Code <contact@creamcode.org>
     7 * @author     CreamCode
    88 * @package    Udp_Agent
    99 */
     
    5656    public function __construct( $ver, $agent_root_dir, $engine_url ) {
    5757
    58         $this->version        = $ver;
    5958        $this->engine_url     = $engine_url;
    6059        $this->agent_root_dir = $agent_root_dir;
     
    102101     */
    103102    public function on_admin_init() {
    104 
    105         $this->show_user_tracking_admin_notice();
    106103
    107104        // register and save settings data.
     
    117114        add_settings_field(
    118115            'udp_agent_allow_tracking',
    119             __( 'Allow Anonymous Tracking', 'udp-agent' ),
     116            esc_html__( 'Allow Anonymous Tracking', 'universal-google-adsense-and-ads-manager' ),
    120117            array( $this, 'show_settings_ui' ),
    121118            'general',
     
    136133     */
    137134    public function get_settings_field_val( $data ) {
    138         if ( '1' === $data ) {
     135        if ( 1 === (int) $data ) {
    139136            return 'yes';
    140137        } else {
     
    161158        }
    162159        echo '/>';
    163         echo wp_kses_data( 'Become a super contributor by sharing your non-sensitive WordPress data. We guarantee no sensitive data is collected. <a href="https://creamcode.org/user-data-processing/" target="_blank" >What data do we collect?</a>' ) . ' </p>';
     160        echo esc_html__( 'Become a super contributor by sharing your non-sensitive WordPress data. We guarantee no sensitive data is collected.', 'universal-google-adsense-and-ads-manager' );
     161        echo wp_kses_data( '<a href="https://creamcode.org/user-data-processing/" target="_blank" > ' . esc_html__( ' What data do we collect?', 'universal-google-adsense-and-ads-manager' ) . '</a>' );
     162        echo ' </p>';
    164163    }
    165164
     
    168167    // Show admin notice, for collecting user data.
    169168    // ----------------------------------------------
    170 
    171     /**
    172      * Show admin notice to collect user data.
    173      *
    174      * @since    1.0.0
    175      */
    176     public function show_user_tracking_admin_notice() {
    177 
    178         $show_admin_notice = true;
    179         $users_choice      = get_option( 'udp_agent_allow_tracking' );
    180 
    181         if ( 'later' !== $users_choice && ! empty( $users_choice ) ) {
    182 
    183             // user has already clicked "yes" or "no" in admin notice.
    184             // do not show this notice.
    185             $show_admin_notice = false;
    186 
    187         } else {
    188 
    189             $tracking_msg_last_shown_at = intval( get_option( 'udp_agent_tracking_msg_last_shown_at' ) );
    190 
    191             if ( $tracking_msg_last_shown_at > ( time() - ( DAY_IN_SECONDS * 3 ) ) ) {
    192                 // do not show,
    193                 // if last admin notice was shown less than 1 day ago.
    194                 $show_admin_notice = false;
    195             }
    196         }
    197 
    198         if ( ! $show_admin_notice ) {
    199             return;
    200         }
    201         $content = '<p>' . sprintf(
    202             /* translators: %s: agent name */
    203             __( '%s is asking to allow tracking your non-sensitive WordPress data?', 'udp-agent' ),
    204             $this->find_agent_name( $this->agent_root_dir )
    205         ) . '</p><p>';
    206 
    207         $content .= sprintf(
    208             /* translators: %s: agent allow access link, %s: Allow */
    209             __( '<a href="%1$s" class="button button-primary udp-agent-access_tracking-yes" style="margin-right: 10px" >%2$s</a>', 'udp-agent' ),
    210             add_query_arg( 'udp-agent-allow-access', 'yes' ),
    211             'Allow'
    212         );
    213 
    214         $content .= sprintf(
    215             /* translators: %s: agent allow access link, %s: Allow */
    216             __( '<a href="%1$s" class="button button-secondary udp-agent-access_tracking-no" style="margin-right: 10px" >%2$s</a>', 'udp-agent' ),
    217             add_query_arg( 'udp-agent-allow-access', 'no' ),
    218             'Do not show again'
    219         );
    220 
    221         $content .= sprintf(
    222             /* translators: %s: agent allow access link, %s: Allow */
    223             __( '<a href="%1$s" class="button button-secondary udp-agent-access_tracking-yes" style="margin-right: 10px" >%2$s</a>', 'udp-agent' ),
    224             add_query_arg( 'udp-agent-allow-access', 'later' ),
    225             'Later'
    226         );
    227 
    228         $content .= '</p>';
    229         $this->show_admin_notice( 'warning', $content );
    230     }
    231 
    232 
    233169
    234170    /**
     
    257193
    258194    }
    259 
    260 
    261     /**
    262      * A little helper function to show admin notice.
    263      *
    264      * @since    1.0.0
    265      * @param string $error_class Error Class/Type.
    266      * @param string $msg Message.
    267      */
    268     private function show_admin_notice( $error_class, $msg ) {
    269         add_action(
    270             'load-index.php',
    271             function () use ( $error_class, $msg ) {
    272                 add_action(
    273                     'admin_notices',
    274                     function() use ( $error_class, $msg ) {
    275                         $class = 'is-dismissible  notice notice-' . $error_class;
    276                         printf( '<div class="%1$s">%2$s</div>', esc_attr( $class ), wp_kses_post( $msg ) );
    277                     }
    278                 );
    279             }
    280         );
    281 
    282     }
    283 
    284195
    285196    // ----------------------------------------------
     
    321232            $dir_names = explode( '\\', $dir_names[ count( $dir_names ) - 1 ] );
    322233        }
    323         $plugin_name           = array_pop( $dir_names );
    324         $this_plugin_data      = get_plugin_data( $plugin_directory . '/' . $plugin_name . '.php' );
    325         $data['sender_client'] = $this_plugin_data['Name'];
     234        $plugin_name = array_pop( $dir_names );
     235        if ( file_exists( $plugin_directory . '/' . $plugin_name . '.php' ) ) {
     236            $this_plugin_data      = get_plugin_data( $plugin_directory . '/' . $plugin_name . '.php' );
     237            $data['sender_client'] = $this_plugin_data['Name'];
     238        } else {
     239            $theme                 = wp_get_theme();
     240            $data['sender_client'] = $theme->name;
     241        }
    326242
    327243        return $data;
     
    332248
    333249    /**
    334      * Authotrize this agent to send data to engine.
     250     * Authorize this agent to send data to engine.
    335251     * get secret key from engine
    336252     * run on agent activation.
     
    362278        $url                = untrailingslashit( $this->engine_url ) . '/wp-json/udp-engine/v1/handshake';
    363279
    364         // get secret key from engine.
    365         $secret_key = json_decode( $this->do_curl( $url, $data ) );
    366 
    367         if ( empty( $secret_key ) ) {
    368             error_log( __FUNCTION__ . ' : Cannot get secret key from engine.' ); //phpcs:ignore
    369             return false;
    370         }
    371 
    372         if ( isset( $secret_key->secret_key ) ) {
    373             // save secret_key into db.
    374             update_option( 'udp_agent_secret_key', $secret_key->secret_key );
    375         } else {
    376             error_log( __FUNCTION__ . $secret_key->message ); //phpcs:ignore
    377             return false;
    378         }
     280        $this->do_curl( $url, $data );
    379281
    380282        return true;
    381283
    382284    }
    383 
    384 
    385     /**
    386      * Find agent's parent's name. It can be theme or plugin.
    387      *
    388      * @since    1.0.0
    389      * @param    string $root_dir Path to root folder of the agents parent.
    390      */
    391     private function find_agent_name( $root_dir ) {
    392 
    393         if ( ! empty( $this->agent_name ) ) {
    394             return $this->agent_name;
    395         }
    396 
    397         $agent_name = '';
    398 
    399         if ( file_exists( $root_dir . '/functions.php' ) ) {
    400             // it is a theme
    401             // return get_style.
    402 
    403             $my_theme = wp_get_theme( basename( $root_dir ) );
    404             if ( $my_theme->exists() ) {
    405                 $agent_name = $my_theme->get( 'Name' );
    406             }
    407         } else {
    408             // it is a plugin.
    409             $plugin_file = $this->agent_root_dir . DIRECTORY_SEPARATOR . basename( $this->agent_root_dir ) . '.php';
    410             $plugin_data = get_file_data(
    411                 $plugin_file,
    412                 array(
    413                     'name' => 'Plugin Name',
    414                 )
    415             );
    416 
    417             $agent_name = $plugin_data['name'];
    418         }
    419         $this->agent_name = $agent_name;
    420         return $agent_name;
    421     }
    422 
    423285
    424286    // ------------------------------------------------
     
    462324        $data_to_send['secret_key'] = get_option( 'udp_agent_secret_key' );
    463325        $url                        = untrailingslashit( $this->engine_url ) . '/wp-json/udp-engine/v1/process-data';
    464         $this->write_log( __FUNCTION__ . $this->do_curl( $url, $data_to_send ) );
     326        // $this->write_log( __FUNCTION__ . $this->do_curl( $url, $data_to_send ) );
     327        $this->do_curl( $url, $data_to_send );
    465328        exit;
    466329
     
    474337     */
    475338    private function write_log( $log ) {
    476         if ( true === WP_DEBUG ) {
     339        if ( true === WP_DEBUG && true === WP_DEBUG_LOG ) {
    477340            if ( is_array( $log ) || is_object( $log ) ) {
    478341                error_log( print_r( $log, true ) ); //phpcs:ignore
  • universal-google-adsense-and-ads-manager/tags/1.1.1/includes/udp/init.php

    r2867532 r2874094  
    11<?php
    22/**
    3  * The file that defines the initial plugin functions
     3 * Init file for the UDP agent.
    44 *
    5  * A hooks definition that includes attributes and functions used across both the
    6  * public-facing side of the site and the admin area.
    7  *
    8  * @link       https://addonify.com/
     5 * @link       https://creamcode.org/user-data-processing/
    96 * @since      1.0.0
    10  *
     7 * @author     CreamCode
    118 * @package    Udp_agent
    129 */
    1310
    14 global $this_agent_ver, $engine_url;
     11// Declared global so they can be used in multiple plugins.
     12// For addressing issues caused by having function declared with same name in multiple plugins.
     13global $this_agent_ver, $engine_url, $root_dir, $udp_admin_notice_displayed;
    1514
    1615// -------------------------------------------
     
    1918
    2019$engine_url     = 'https://udp.creamcode.org/';
    21 $this_agent_ver = '1.0.0';
     20$this_agent_ver = '1.0.1';
    2221
    2322// -------------------------------------------
     
    3635}
    3736
     37if ( ! isset( $all_installed_agents[ basename( $root_dir ) ] ) ) {
     38    $installed_agents                          = get_option( 'udp_installed_agents', array() );
     39    $installed_agents[ basename( $root_dir ) ] = $this_agent_ver;
     40
     41    // register this agent locally.
     42    update_option( 'udp_installed_agents', $installed_agents );
     43}
     44
    3845// load this agent, only if it is the latest version and this agent is installed.
    3946if ( $this_agent_is_latest && isset( $all_installed_agents[ basename( $root_dir ) ] ) ) {
     
    4148        require_once plugin_dir_path( dirname( __FILE__ ) ) . '/udp/class-udp-agent.php';
    4249    }
    43     new Udp_Agent( $this_agent_ver, $root_dir, $engine_url );
    44 }
    45 
    46 if ( ! function_exists( 'cc_udp_agent_initial_handshake' ) ) {
    47     /**
    48      * Does Initial handshake with udp engine.
    49      */
    50     function cc_udp_agent_initial_handshake() {
    51         global $this_agent_ver, $engine_url;
    52         $root_dir = dirname( dirname( __DIR__ ) );
    53 
    54         // authorize this agent with engine.
    55         if ( ! class_exists( 'Udp_Agent' ) ) {
    56             require_once plugin_dir_path( dirname( __FILE__ ) ) . '/udp/class-udp-agent.php';
    57         }
    58         $agent = new Udp_Agent( $this_agent_ver, $root_dir, $engine_url );
    59         $agent->do_handshake();
    60 
    61         $installed_agents                          = get_option( 'udp_installed_agents', array() );
    62         $installed_agents[ basename( $root_dir ) ] = $this_agent_ver;
    63 
    64         // register this agent locally.
    65         update_option( 'udp_installed_agents', $installed_agents );
    66 
    67         // show admin notice if user selected "no" but new agent is installed.
    68         $show_admin_notice = get_option( 'udp_agent_allow_tracking' );
    69         if ( 'no' === $show_admin_notice ) {
    70             $active_agent = get_option( 'udp_active_agent_basename' );
    71             if ( basename( $root_dir ) !== $active_agent ) {
    72                 update_option( 'udp_active_agent_basename', basename( $root_dir ) );
    73                 delete_option( 'udp_agent_allow_tracking' );
    74             }
    75         }
    76     }
    77 }
    78 
    79 if ( empty( (array)$all_installed_agents ) ) { //phpcs:ignore
    80     cc_udp_agent_initial_handshake();
     50    new Udp_Agent( $this_agent_ver, $root_dir, $engine_url, $udp_admin_notice_displayed );
     51    if ( ! isset( $udp_admin_notice_displayed ) || ! $udp_admin_notice_displayed ) {
     52        $udp_admin_notice_displayed = true;
     53        add_action(
     54            'admin_init',
     55            function () {
     56                $root_dir = dirname( dirname( __DIR__ ) );
     57
     58                $show_admin_notice = true;
     59                $users_choice      = get_option( 'udp_agent_allow_tracking' );
     60
     61                if ( 'later' !== $users_choice && ! empty( $users_choice ) ) {
     62
     63                    // user has already clicked "yes" or "no" in admin notice.
     64                    // do not show this notice.
     65                    $show_admin_notice = false;
     66
     67                } else {
     68
     69                    $tracking_msg_last_shown_at = intval( get_option( 'udp_agent_tracking_msg_last_shown_at' ) );
     70
     71                    if ( $tracking_msg_last_shown_at > ( time() - ( DAY_IN_SECONDS * 3 ) ) ) {
     72                        // do not show,
     73                        // if last admin notice was shown less than 1 day ago.
     74                        $show_admin_notice = false;
     75                    }
     76                }
     77
     78                if ( ! $show_admin_notice ) {
     79                    return;
     80                }
     81                if ( file_exists( $root_dir . DIRECTORY_SEPARATOR . basename( $root_dir ) . '.php' ) ) {
     82                    $plugin_file = $root_dir . DIRECTORY_SEPARATOR . basename( $root_dir ) . '.php';
     83                    $plugin_data = get_file_data(
     84                        $plugin_file,
     85                        array(
     86                            'name'       => 'Plugin Name',
     87                            'textdomain' => 'Text Domain',
     88                        )
     89                    );
     90
     91                    $agent_name = $plugin_data['name'];
     92                } else {
     93                    $theme      = wp_get_theme();
     94                    $agent_name = $theme->name;
     95                }
     96
     97                $content = '<p>' . sprintf(
     98                    /* translators: %s: agent name */
     99                    esc_html__( '%s is asking to allow tracking your non-sensitive WordPress data?', 'universal-google-adsense-and-ads-manager' ),
     100                    $agent_name
     101                ) . '</p><p>';
     102
     103                $content .= sprintf(
     104                    /* translators: %s: agent allow access link, %s: Allow */
     105                    '<a href="%1$s" class="button button-primary udp-agent-access_tracking-yes" style="margin-right: 10px" >%2$s</a>',
     106                    add_query_arg( 'udp-agent-allow-access', 'yes' ),
     107                    esc_html__( 'Allow', 'universal-google-adsense-and-ads-manager' )
     108                );
     109
     110                $content .= sprintf(
     111                    /* translators: %s: agent allow access link, %s: Allow */
     112                    '<a href="%1$s" class="button button-secondary udp-agent-access_tracking-no" style="margin-right: 10px" >%2$s</a>',
     113                    add_query_arg( 'udp-agent-allow-access', 'no' ),
     114                    esc_html__( 'Do not show again', 'universal-google-adsense-and-ads-manager' )
     115                );
     116
     117                $content .= sprintf(
     118                    /* translators: %s: agent allow access link, %s: Allow */
     119                    '<a href="%1$s" class="button button-secondary udp-agent-access_tracking-yes" style="margin-right: 10px" >%2$s</a>',
     120                    add_query_arg( 'udp-agent-allow-access', 'later' ),
     121                    esc_html__( 'Later', 'universal-google-adsense-and-ads-manager' )
     122                );
     123
     124                $content .= '</p>';
     125                add_action(
     126                    'load-index.php',
     127                    function () use ( $content ) {
     128                        add_action(
     129                            'admin_notices',
     130                            function() use ( $content ) {
     131                                $class = 'is-dismissible  notice notice-warning';
     132                                printf( '<div class="%1$s">%2$s</div>', esc_attr( $class ), wp_kses_post( $content ) );
     133                            }
     134                        );
     135                    }
     136                );
     137            }
     138        );
     139    }
    81140}
    82141
     
    85144// -------------------------------------------
    86145
    87 // for plugin.
    88 register_activation_hook(
    89     $root_dir . DIRECTORY_SEPARATOR . basename( $root_dir ) . '.php',
    90     'cc_udp_agent_initial_handshake'
    91 );
     146if ( file_exists( $root_dir . DIRECTORY_SEPARATOR . basename( $root_dir ) . '.php' ) ) {
     147    // for plugin.
     148    register_activation_hook(
     149        $root_dir . DIRECTORY_SEPARATOR . basename( $root_dir ) . '.php',
     150        function () use ( $this_agent_ver, $engine_url ) {
     151            $root_dir = dirname( dirname( __DIR__ ) );
     152
     153            // authorize this agent with engine.
     154            if ( ! class_exists( 'Udp_Agent' ) ) {
     155                require_once plugin_dir_path( dirname( __FILE__ ) ) . '/udp/class-udp-agent.php';
     156            }
     157            $agent = new Udp_Agent( $this_agent_ver, $root_dir, $engine_url );
     158            $agent->do_handshake();
     159
     160            // show admin notice if user selected "no" but new agent is installed.
     161            $show_admin_notice = get_option( 'udp_agent_allow_tracking' );
     162            if ( 'no' === $show_admin_notice ) {
     163                $active_agent = get_option( 'udp_active_agent_basename' );
     164                if ( basename( $root_dir ) !== $active_agent ) {
     165                    update_option( 'udp_active_agent_basename', basename( $root_dir ) );
     166                    delete_option( 'udp_agent_allow_tracking' );
     167                }
     168            }
     169        }
     170    );
     171}
    92172
    93173if ( ! function_exists( 'cc_udp_agent_send_data_on_action' ) ) {
     
    164244// -------------------------------------------
    165245
    166 // for plugin.
    167 register_deactivation_hook(
    168     $root_dir . DIRECTORY_SEPARATOR . basename( $root_dir ) . '.php',
     246if ( file_exists( $root_dir . DIRECTORY_SEPARATOR . basename( $root_dir ) . '.php' ) ) {
     247    // for plugin.
     248    register_deactivation_hook(
     249        $root_dir . DIRECTORY_SEPARATOR . basename( $root_dir ) . '.php',
     250        function () use ( $root_dir ) {
     251
     252            $installed_agents = get_option( 'udp_installed_agents', array() );
     253            if ( isset( $installed_agents[ basename( $root_dir ) ] ) ) {
     254                unset( $installed_agents[ basename( $root_dir ) ] );
     255            }
     256
     257            // remove this agent from the list of active agents.
     258            update_option( 'udp_installed_agents', $installed_agents );
     259            $timestamp = wp_next_scheduled( 'udp_agent_cron' );
     260            wp_unschedule_event( $timestamp, 'udp_agent_cron' );
     261        }
     262    );
     263}
     264
     265// for theme.
     266add_action(
     267    'switch_theme',
    169268    function () use ( $root_dir ) {
    170269
     
    176275        // remove this agent from the list of active agents.
    177276        update_option( 'udp_installed_agents', $installed_agents );
    178         $timestamp = wp_next_scheduled( 'udp_agent_cron' );
    179         wp_unschedule_event( $timestamp, 'udp_agent_cron' );
    180     }
    181 );
    182 
    183 // for theme.
    184 add_action(
    185     'switch_theme',
    186     function () use ( $root_dir ) {
    187 
    188         $installed_agents = get_option( 'udp_installed_agents', array() );
    189         if ( isset( $installed_agents[ basename( $root_dir ) ] ) ) {
    190             unset( $installed_agents[ basename( $root_dir ) ] );
    191         }
    192 
    193         // remove this agent from the list of active agents.
    194         update_option( 'udp_installed_agents', $installed_agents );
    195     }
    196 );
     277    }
     278);
  • universal-google-adsense-and-ads-manager/tags/1.1.1/languages/universal-google-adsense-and-ads-manager.pot

    r2662032 r2874094  
    1 # Copyright (C) 2019 Universal Google AdSense And Ads Manager
    2 # This file is distributed under the same license as the Universal Google AdSense And Ads Manager package.
     1# Copyright (C) 2023 themebeez
     2# This file is distributed under the GPL-2.0+.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Universal Google AdSense And Ads Manager\n"
     5"Project-Id-Version: Universal Google AdSense and Ads Manager 1.1.1\n"
     6"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/universal-google-adsense-and-ads-manager\n"
     7"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     8"Language-Team: LANGUAGE <LL@li.org>\n"
    69"MIME-Version: 1.0\n"
    710"Content-Type: text/plain; charset=UTF-8\n"
    811"Content-Transfer-Encoding: 8bit\n"
    9 "Language-Team: themebeez <themebeez@gmail.com>\n"
    10 "X-Poedit-Basepath: ..\n"
    11 "X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
    12 "X-Poedit-SearchPath-0: .\n"
    13 "X-Poedit-SearchPathExcluded-0: *.js\n"
    14 "X-Poedit-SourceCharset: UTF-8\n"
    15 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
     12"POT-Creation-Date: 2023-03-03T06:35:44+00:00\n"
     13"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
     14"X-Generator: WP-CLI 2.7.1\n"
     15"X-Domain: universal-google-adsense-and-ads-manager\n"
     16
     17#. Plugin Name of the plugin
     18msgid "Universal Google AdSense and Ads Manager"
     19msgstr ""
     20
     21#. Plugin URI of the plugin
     22msgid "https://themebeez.com/universal-google-adsense-ads-manager"
     23msgstr ""
     24
     25#. Description of the plugin
     26msgid "Universal Google AdSense and Ads Manager is a simple, and easy to use Google AdSense and custom advertisement manager for your WordPress websites."
     27msgstr ""
     28
     29#. Author of the plugin
     30msgid "themebeez"
     31msgstr ""
     32
     33#. Author URI of the plugin
     34msgid "https://themebeez.com"
     35msgstr ""
    1636
    1737#: admin/partials/ugaam-admin-display.php:26
     
    92112
    93113#: admin/partials/ugaam-admin-display.php:126
     114msgid "Ugaam Walk-through Video ..."
     115msgstr ""
     116
     117#: admin/partials/ugaam-admin-display.php:135
    94118msgid "Quick Links ..."
    95119msgstr ""
    96120
    97 #: admin/partials/ugaam-admin-display.php:129
     121#: admin/partials/ugaam-admin-display.php:138
    98122msgid "Insert Scripts"
    99123msgstr ""
    100124
    101 #: admin/partials/ugaam-admin-display.php:130
     125#: admin/partials/ugaam-admin-display.php:139
    102126msgid "Insert Ads"
    103127msgstr ""
    104128
    105 #: admin/partials/ugaam-admin-display.php:131
     129#: admin/partials/ugaam-admin-display.php:140
    106130msgid "UGAAM Documenation"
    107131msgstr ""
    108132
    109 #: admin/partials/ugaam-admin-display.php:132
     133#: admin/partials/ugaam-admin-display.php:141
    110134msgid "Get Support"
    111135msgstr ""
    112136
    113 #: admin/partials/ugaam-admin-display.php:133
     137#: admin/partials/ugaam-admin-display.php:142
    114138msgid "Rate UGAAM"
    115139msgstr ""
     
    127151msgstr ""
    128152
    129 #: includes/customizer/controls/class-customizer-responsive-dimension-control.php:66, includes/customizer/functions/customizer-choices.php:13
     153#: includes/customizer/controls/class-customizer-responsive-dimension-control.php:66
     154#: includes/customizer/functions/customizer-choices.php:13
    130155msgid "Right"
    131156msgstr ""
     
    135160msgstr ""
    136161
    137 #: includes/customizer/controls/class-customizer-responsive-dimension-control.php:66, includes/customizer/functions/customizer-choices.php:12
     162#: includes/customizer/controls/class-customizer-responsive-dimension-control.php:66
     163#: includes/customizer/functions/customizer-choices.php:12
    138164msgid "Left"
    139165msgstr ""
     
    147173msgstr ""
    148174
    149 #: includes/customizer/functions/customizer-choices.php:25, includes/widgets/class-ugaam-ad-widget.php:169
     175#: includes/customizer/functions/customizer-choices.php:25
     176#: includes/widgets/class-ugaam-ad-widget.php:169
    150177msgid "Custom Ad"
    151178msgstr ""
    152179
    153 #: includes/customizer/functions/customizer-choices.php:26, includes/widgets/class-ugaam-ad-widget.php:170
     180#: includes/customizer/functions/customizer-choices.php:26
     181#: includes/widgets/class-ugaam-ad-widget.php:170
    154182msgid "AdSense Ad"
    155183msgstr ""
     
    272300
    273301#: includes/customizer/functions/customizer-fields.php:42
    274 msgid "Universal Google AdSense &amp; Ad Manager"
     302msgid "Universal Google AdSense &amp; Ads Manager"
    275303msgstr ""
    276304
     
    299327msgstr ""
    300328
    301 #: includes/customizer/functions/customizer-fields.php:133, includes/customizer/functions/customizer-fields.php:158, includes/customizer/functions/customizer-fields.php:183, includes/customizer/functions/customizer-fields.php:208, includes/customizer/functions/customizer-fields.php:227
     329#: includes/customizer/functions/customizer-fields.php:133
     330#: includes/customizer/functions/customizer-fields.php:158
     331#: includes/customizer/functions/customizer-fields.php:183
     332#: includes/customizer/functions/customizer-fields.php:208
     333#: includes/customizer/functions/customizer-fields.php:227
    302334msgid "If you want to show same Ad on mobiles as in desktop, paste the above code below "
     335msgstr ""
     336
     337#: includes/udp/class-udp-agent.php:116
     338msgid "Allow Anonymous Tracking"
     339msgstr ""
     340
     341#: includes/udp/class-udp-agent.php:160
     342msgid "Become a super contributor by sharing your non-sensitive WordPress data. We guarantee no sensitive data is collected."
     343msgstr ""
     344
     345#: includes/udp/class-udp-agent.php:161
     346msgid " What data do we collect?"
     347msgstr ""
     348
     349#. translators: %s: agent name
     350#: includes/udp/init.php:99
     351msgid "%s is asking to allow tracking your non-sensitive WordPress data?"
     352msgstr ""
     353
     354#: includes/udp/init.php:107
     355msgid "Allow"
     356msgstr ""
     357
     358#: includes/udp/init.php:114
     359msgid "Do not show again"
     360msgstr ""
     361
     362#: includes/udp/init.php:121
     363msgid "Later"
    303364msgstr ""
    304365
  • universal-google-adsense-and-ads-manager/tags/1.1.1/universal-google-adsense-and-ads-manager.php

    r2867532 r2874094  
    44 * Plugin URI:        https://themebeez.com/universal-google-adsense-ads-manager
    55 * Description:       Universal Google AdSense and Ads Manager is a simple, and easy to use Google AdSense and custom advertisement manager for your WordPress websites.
    6  * Version:           1.1.0
     6 * Version:           1.1.1
    77 * Author:            themebeez
    88 * Author URI:        https://themebeez.com
     
    2323 * Rename this for your plugin and update it as you release new versions.
    2424 */
    25 define( 'UNIVERSAL_GOOGLE_ADSENSE_AND_ADS_MANAGER_VERSION', '1.1.0' );
     25define( 'UNIVERSAL_GOOGLE_ADSENSE_AND_ADS_MANAGER_VERSION', '1.1.1' );
    2626
    2727/**
  • universal-google-adsense-and-ads-manager/trunk/README.txt

    r2867532 r2874094  
    66Tested up to: 6.1.1
    77Requires PHP: 7.0.0
    8 Stable tag: 1.1.0
     8Stable tag: 1.1.1
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    174174== Changelog ==
    175175
     176= 1.1.1 - 03 March, 2023 =
     177
     178- Updated: UDP version to 1.0.1.
     179
    176180= 1.1.0 - 19 February, 2023 =
    177181
  • universal-google-adsense-and-ads-manager/trunk/includes/udp/class-udp-agent.php

    r2867532 r2874094  
    55 * @link       https://creamcode.org/user-data-processing/
    66 * @since      1.0.0
    7  * @author     Cream Code <contact@creamcode.org>
     7 * @author     CreamCode
    88 * @package    Udp_Agent
    99 */
     
    5656    public function __construct( $ver, $agent_root_dir, $engine_url ) {
    5757
    58         $this->version        = $ver;
    5958        $this->engine_url     = $engine_url;
    6059        $this->agent_root_dir = $agent_root_dir;
     
    102101     */
    103102    public function on_admin_init() {
    104 
    105         $this->show_user_tracking_admin_notice();
    106103
    107104        // register and save settings data.
     
    117114        add_settings_field(
    118115            'udp_agent_allow_tracking',
    119             __( 'Allow Anonymous Tracking', 'udp-agent' ),
     116            esc_html__( 'Allow Anonymous Tracking', 'universal-google-adsense-and-ads-manager' ),
    120117            array( $this, 'show_settings_ui' ),
    121118            'general',
     
    136133     */
    137134    public function get_settings_field_val( $data ) {
    138         if ( '1' === $data ) {
     135        if ( 1 === (int) $data ) {
    139136            return 'yes';
    140137        } else {
     
    161158        }
    162159        echo '/>';
    163         echo wp_kses_data( 'Become a super contributor by sharing your non-sensitive WordPress data. We guarantee no sensitive data is collected. <a href="https://creamcode.org/user-data-processing/" target="_blank" >What data do we collect?</a>' ) . ' </p>';
     160        echo esc_html__( 'Become a super contributor by sharing your non-sensitive WordPress data. We guarantee no sensitive data is collected.', 'universal-google-adsense-and-ads-manager' );
     161        echo wp_kses_data( '<a href="https://creamcode.org/user-data-processing/" target="_blank" > ' . esc_html__( ' What data do we collect?', 'universal-google-adsense-and-ads-manager' ) . '</a>' );
     162        echo ' </p>';
    164163    }
    165164
     
    168167    // Show admin notice, for collecting user data.
    169168    // ----------------------------------------------
    170 
    171     /**
    172      * Show admin notice to collect user data.
    173      *
    174      * @since    1.0.0
    175      */
    176     public function show_user_tracking_admin_notice() {
    177 
    178         $show_admin_notice = true;
    179         $users_choice      = get_option( 'udp_agent_allow_tracking' );
    180 
    181         if ( 'later' !== $users_choice && ! empty( $users_choice ) ) {
    182 
    183             // user has already clicked "yes" or "no" in admin notice.
    184             // do not show this notice.
    185             $show_admin_notice = false;
    186 
    187         } else {
    188 
    189             $tracking_msg_last_shown_at = intval( get_option( 'udp_agent_tracking_msg_last_shown_at' ) );
    190 
    191             if ( $tracking_msg_last_shown_at > ( time() - ( DAY_IN_SECONDS * 3 ) ) ) {
    192                 // do not show,
    193                 // if last admin notice was shown less than 1 day ago.
    194                 $show_admin_notice = false;
    195             }
    196         }
    197 
    198         if ( ! $show_admin_notice ) {
    199             return;
    200         }
    201         $content = '<p>' . sprintf(
    202             /* translators: %s: agent name */
    203             __( '%s is asking to allow tracking your non-sensitive WordPress data?', 'udp-agent' ),
    204             $this->find_agent_name( $this->agent_root_dir )
    205         ) . '</p><p>';
    206 
    207         $content .= sprintf(
    208             /* translators: %s: agent allow access link, %s: Allow */
    209             __( '<a href="%1$s" class="button button-primary udp-agent-access_tracking-yes" style="margin-right: 10px" >%2$s</a>', 'udp-agent' ),
    210             add_query_arg( 'udp-agent-allow-access', 'yes' ),
    211             'Allow'
    212         );
    213 
    214         $content .= sprintf(
    215             /* translators: %s: agent allow access link, %s: Allow */
    216             __( '<a href="%1$s" class="button button-secondary udp-agent-access_tracking-no" style="margin-right: 10px" >%2$s</a>', 'udp-agent' ),
    217             add_query_arg( 'udp-agent-allow-access', 'no' ),
    218             'Do not show again'
    219         );
    220 
    221         $content .= sprintf(
    222             /* translators: %s: agent allow access link, %s: Allow */
    223             __( '<a href="%1$s" class="button button-secondary udp-agent-access_tracking-yes" style="margin-right: 10px" >%2$s</a>', 'udp-agent' ),
    224             add_query_arg( 'udp-agent-allow-access', 'later' ),
    225             'Later'
    226         );
    227 
    228         $content .= '</p>';
    229         $this->show_admin_notice( 'warning', $content );
    230     }
    231 
    232 
    233169
    234170    /**
     
    257193
    258194    }
    259 
    260 
    261     /**
    262      * A little helper function to show admin notice.
    263      *
    264      * @since    1.0.0
    265      * @param string $error_class Error Class/Type.
    266      * @param string $msg Message.
    267      */
    268     private function show_admin_notice( $error_class, $msg ) {
    269         add_action(
    270             'load-index.php',
    271             function () use ( $error_class, $msg ) {
    272                 add_action(
    273                     'admin_notices',
    274                     function() use ( $error_class, $msg ) {
    275                         $class = 'is-dismissible  notice notice-' . $error_class;
    276                         printf( '<div class="%1$s">%2$s</div>', esc_attr( $class ), wp_kses_post( $msg ) );
    277                     }
    278                 );
    279             }
    280         );
    281 
    282     }
    283 
    284195
    285196    // ----------------------------------------------
     
    321232            $dir_names = explode( '\\', $dir_names[ count( $dir_names ) - 1 ] );
    322233        }
    323         $plugin_name           = array_pop( $dir_names );
    324         $this_plugin_data      = get_plugin_data( $plugin_directory . '/' . $plugin_name . '.php' );
    325         $data['sender_client'] = $this_plugin_data['Name'];
     234        $plugin_name = array_pop( $dir_names );
     235        if ( file_exists( $plugin_directory . '/' . $plugin_name . '.php' ) ) {
     236            $this_plugin_data      = get_plugin_data( $plugin_directory . '/' . $plugin_name . '.php' );
     237            $data['sender_client'] = $this_plugin_data['Name'];
     238        } else {
     239            $theme                 = wp_get_theme();
     240            $data['sender_client'] = $theme->name;
     241        }
    326242
    327243        return $data;
     
    332248
    333249    /**
    334      * Authotrize this agent to send data to engine.
     250     * Authorize this agent to send data to engine.
    335251     * get secret key from engine
    336252     * run on agent activation.
     
    362278        $url                = untrailingslashit( $this->engine_url ) . '/wp-json/udp-engine/v1/handshake';
    363279
    364         // get secret key from engine.
    365         $secret_key = json_decode( $this->do_curl( $url, $data ) );
    366 
    367         if ( empty( $secret_key ) ) {
    368             error_log( __FUNCTION__ . ' : Cannot get secret key from engine.' ); //phpcs:ignore
    369             return false;
    370         }
    371 
    372         if ( isset( $secret_key->secret_key ) ) {
    373             // save secret_key into db.
    374             update_option( 'udp_agent_secret_key', $secret_key->secret_key );
    375         } else {
    376             error_log( __FUNCTION__ . $secret_key->message ); //phpcs:ignore
    377             return false;
    378         }
     280        $this->do_curl( $url, $data );
    379281
    380282        return true;
    381283
    382284    }
    383 
    384 
    385     /**
    386      * Find agent's parent's name. It can be theme or plugin.
    387      *
    388      * @since    1.0.0
    389      * @param    string $root_dir Path to root folder of the agents parent.
    390      */
    391     private function find_agent_name( $root_dir ) {
    392 
    393         if ( ! empty( $this->agent_name ) ) {
    394             return $this->agent_name;
    395         }
    396 
    397         $agent_name = '';
    398 
    399         if ( file_exists( $root_dir . '/functions.php' ) ) {
    400             // it is a theme
    401             // return get_style.
    402 
    403             $my_theme = wp_get_theme( basename( $root_dir ) );
    404             if ( $my_theme->exists() ) {
    405                 $agent_name = $my_theme->get( 'Name' );
    406             }
    407         } else {
    408             // it is a plugin.
    409             $plugin_file = $this->agent_root_dir . DIRECTORY_SEPARATOR . basename( $this->agent_root_dir ) . '.php';
    410             $plugin_data = get_file_data(
    411                 $plugin_file,
    412                 array(
    413                     'name' => 'Plugin Name',
    414                 )
    415             );
    416 
    417             $agent_name = $plugin_data['name'];
    418         }
    419         $this->agent_name = $agent_name;
    420         return $agent_name;
    421     }
    422 
    423285
    424286    // ------------------------------------------------
     
    462324        $data_to_send['secret_key'] = get_option( 'udp_agent_secret_key' );
    463325        $url                        = untrailingslashit( $this->engine_url ) . '/wp-json/udp-engine/v1/process-data';
    464         $this->write_log( __FUNCTION__ . $this->do_curl( $url, $data_to_send ) );
     326        // $this->write_log( __FUNCTION__ . $this->do_curl( $url, $data_to_send ) );
     327        $this->do_curl( $url, $data_to_send );
    465328        exit;
    466329
     
    474337     */
    475338    private function write_log( $log ) {
    476         if ( true === WP_DEBUG ) {
     339        if ( true === WP_DEBUG && true === WP_DEBUG_LOG ) {
    477340            if ( is_array( $log ) || is_object( $log ) ) {
    478341                error_log( print_r( $log, true ) ); //phpcs:ignore
  • universal-google-adsense-and-ads-manager/trunk/includes/udp/init.php

    r2867532 r2874094  
    11<?php
    22/**
    3  * The file that defines the initial plugin functions
     3 * Init file for the UDP agent.
    44 *
    5  * A hooks definition that includes attributes and functions used across both the
    6  * public-facing side of the site and the admin area.
    7  *
    8  * @link       https://addonify.com/
     5 * @link       https://creamcode.org/user-data-processing/
    96 * @since      1.0.0
    10  *
     7 * @author     CreamCode
    118 * @package    Udp_agent
    129 */
    1310
    14 global $this_agent_ver, $engine_url;
     11// Declared global so they can be used in multiple plugins.
     12// For addressing issues caused by having function declared with same name in multiple plugins.
     13global $this_agent_ver, $engine_url, $root_dir, $udp_admin_notice_displayed;
    1514
    1615// -------------------------------------------
     
    1918
    2019$engine_url     = 'https://udp.creamcode.org/';
    21 $this_agent_ver = '1.0.0';
     20$this_agent_ver = '1.0.1';
    2221
    2322// -------------------------------------------
     
    3635}
    3736
     37if ( ! isset( $all_installed_agents[ basename( $root_dir ) ] ) ) {
     38    $installed_agents                          = get_option( 'udp_installed_agents', array() );
     39    $installed_agents[ basename( $root_dir ) ] = $this_agent_ver;
     40
     41    // register this agent locally.
     42    update_option( 'udp_installed_agents', $installed_agents );
     43}
     44
    3845// load this agent, only if it is the latest version and this agent is installed.
    3946if ( $this_agent_is_latest && isset( $all_installed_agents[ basename( $root_dir ) ] ) ) {
     
    4148        require_once plugin_dir_path( dirname( __FILE__ ) ) . '/udp/class-udp-agent.php';
    4249    }
    43     new Udp_Agent( $this_agent_ver, $root_dir, $engine_url );
    44 }
    45 
    46 if ( ! function_exists( 'cc_udp_agent_initial_handshake' ) ) {
    47     /**
    48      * Does Initial handshake with udp engine.
    49      */
    50     function cc_udp_agent_initial_handshake() {
    51         global $this_agent_ver, $engine_url;
    52         $root_dir = dirname( dirname( __DIR__ ) );
    53 
    54         // authorize this agent with engine.
    55         if ( ! class_exists( 'Udp_Agent' ) ) {
    56             require_once plugin_dir_path( dirname( __FILE__ ) ) . '/udp/class-udp-agent.php';
    57         }
    58         $agent = new Udp_Agent( $this_agent_ver, $root_dir, $engine_url );
    59         $agent->do_handshake();
    60 
    61         $installed_agents                          = get_option( 'udp_installed_agents', array() );
    62         $installed_agents[ basename( $root_dir ) ] = $this_agent_ver;
    63 
    64         // register this agent locally.
    65         update_option( 'udp_installed_agents', $installed_agents );
    66 
    67         // show admin notice if user selected "no" but new agent is installed.
    68         $show_admin_notice = get_option( 'udp_agent_allow_tracking' );
    69         if ( 'no' === $show_admin_notice ) {
    70             $active_agent = get_option( 'udp_active_agent_basename' );
    71             if ( basename( $root_dir ) !== $active_agent ) {
    72                 update_option( 'udp_active_agent_basename', basename( $root_dir ) );
    73                 delete_option( 'udp_agent_allow_tracking' );
    74             }
    75         }
    76     }
    77 }
    78 
    79 if ( empty( (array)$all_installed_agents ) ) { //phpcs:ignore
    80     cc_udp_agent_initial_handshake();
     50    new Udp_Agent( $this_agent_ver, $root_dir, $engine_url, $udp_admin_notice_displayed );
     51    if ( ! isset( $udp_admin_notice_displayed ) || ! $udp_admin_notice_displayed ) {
     52        $udp_admin_notice_displayed = true;
     53        add_action(
     54            'admin_init',
     55            function () {
     56                $root_dir = dirname( dirname( __DIR__ ) );
     57
     58                $show_admin_notice = true;
     59                $users_choice      = get_option( 'udp_agent_allow_tracking' );
     60
     61                if ( 'later' !== $users_choice && ! empty( $users_choice ) ) {
     62
     63                    // user has already clicked "yes" or "no" in admin notice.
     64                    // do not show this notice.
     65                    $show_admin_notice = false;
     66
     67                } else {
     68
     69                    $tracking_msg_last_shown_at = intval( get_option( 'udp_agent_tracking_msg_last_shown_at' ) );
     70
     71                    if ( $tracking_msg_last_shown_at > ( time() - ( DAY_IN_SECONDS * 3 ) ) ) {
     72                        // do not show,
     73                        // if last admin notice was shown less than 1 day ago.
     74                        $show_admin_notice = false;
     75                    }
     76                }
     77
     78                if ( ! $show_admin_notice ) {
     79                    return;
     80                }
     81                if ( file_exists( $root_dir . DIRECTORY_SEPARATOR . basename( $root_dir ) . '.php' ) ) {
     82                    $plugin_file = $root_dir . DIRECTORY_SEPARATOR . basename( $root_dir ) . '.php';
     83                    $plugin_data = get_file_data(
     84                        $plugin_file,
     85                        array(
     86                            'name'       => 'Plugin Name',
     87                            'textdomain' => 'Text Domain',
     88                        )
     89                    );
     90
     91                    $agent_name = $plugin_data['name'];
     92                } else {
     93                    $theme      = wp_get_theme();
     94                    $agent_name = $theme->name;
     95                }
     96
     97                $content = '<p>' . sprintf(
     98                    /* translators: %s: agent name */
     99                    esc_html__( '%s is asking to allow tracking your non-sensitive WordPress data?', 'universal-google-adsense-and-ads-manager' ),
     100                    $agent_name
     101                ) . '</p><p>';
     102
     103                $content .= sprintf(
     104                    /* translators: %s: agent allow access link, %s: Allow */
     105                    '<a href="%1$s" class="button button-primary udp-agent-access_tracking-yes" style="margin-right: 10px" >%2$s</a>',
     106                    add_query_arg( 'udp-agent-allow-access', 'yes' ),
     107                    esc_html__( 'Allow', 'universal-google-adsense-and-ads-manager' )
     108                );
     109
     110                $content .= sprintf(
     111                    /* translators: %s: agent allow access link, %s: Allow */
     112                    '<a href="%1$s" class="button button-secondary udp-agent-access_tracking-no" style="margin-right: 10px" >%2$s</a>',
     113                    add_query_arg( 'udp-agent-allow-access', 'no' ),
     114                    esc_html__( 'Do not show again', 'universal-google-adsense-and-ads-manager' )
     115                );
     116
     117                $content .= sprintf(
     118                    /* translators: %s: agent allow access link, %s: Allow */
     119                    '<a href="%1$s" class="button button-secondary udp-agent-access_tracking-yes" style="margin-right: 10px" >%2$s</a>',
     120                    add_query_arg( 'udp-agent-allow-access', 'later' ),
     121                    esc_html__( 'Later', 'universal-google-adsense-and-ads-manager' )
     122                );
     123
     124                $content .= '</p>';
     125                add_action(
     126                    'load-index.php',
     127                    function () use ( $content ) {
     128                        add_action(
     129                            'admin_notices',
     130                            function() use ( $content ) {
     131                                $class = 'is-dismissible  notice notice-warning';
     132                                printf( '<div class="%1$s">%2$s</div>', esc_attr( $class ), wp_kses_post( $content ) );
     133                            }
     134                        );
     135                    }
     136                );
     137            }
     138        );
     139    }
    81140}
    82141
     
    85144// -------------------------------------------
    86145
    87 // for plugin.
    88 register_activation_hook(
    89     $root_dir . DIRECTORY_SEPARATOR . basename( $root_dir ) . '.php',
    90     'cc_udp_agent_initial_handshake'
    91 );
     146if ( file_exists( $root_dir . DIRECTORY_SEPARATOR . basename( $root_dir ) . '.php' ) ) {
     147    // for plugin.
     148    register_activation_hook(
     149        $root_dir . DIRECTORY_SEPARATOR . basename( $root_dir ) . '.php',
     150        function () use ( $this_agent_ver, $engine_url ) {
     151            $root_dir = dirname( dirname( __DIR__ ) );
     152
     153            // authorize this agent with engine.
     154            if ( ! class_exists( 'Udp_Agent' ) ) {
     155                require_once plugin_dir_path( dirname( __FILE__ ) ) . '/udp/class-udp-agent.php';
     156            }
     157            $agent = new Udp_Agent( $this_agent_ver, $root_dir, $engine_url );
     158            $agent->do_handshake();
     159
     160            // show admin notice if user selected "no" but new agent is installed.
     161            $show_admin_notice = get_option( 'udp_agent_allow_tracking' );
     162            if ( 'no' === $show_admin_notice ) {
     163                $active_agent = get_option( 'udp_active_agent_basename' );
     164                if ( basename( $root_dir ) !== $active_agent ) {
     165                    update_option( 'udp_active_agent_basename', basename( $root_dir ) );
     166                    delete_option( 'udp_agent_allow_tracking' );
     167                }
     168            }
     169        }
     170    );
     171}
    92172
    93173if ( ! function_exists( 'cc_udp_agent_send_data_on_action' ) ) {
     
    164244// -------------------------------------------
    165245
    166 // for plugin.
    167 register_deactivation_hook(
    168     $root_dir . DIRECTORY_SEPARATOR . basename( $root_dir ) . '.php',
     246if ( file_exists( $root_dir . DIRECTORY_SEPARATOR . basename( $root_dir ) . '.php' ) ) {
     247    // for plugin.
     248    register_deactivation_hook(
     249        $root_dir . DIRECTORY_SEPARATOR . basename( $root_dir ) . '.php',
     250        function () use ( $root_dir ) {
     251
     252            $installed_agents = get_option( 'udp_installed_agents', array() );
     253            if ( isset( $installed_agents[ basename( $root_dir ) ] ) ) {
     254                unset( $installed_agents[ basename( $root_dir ) ] );
     255            }
     256
     257            // remove this agent from the list of active agents.
     258            update_option( 'udp_installed_agents', $installed_agents );
     259            $timestamp = wp_next_scheduled( 'udp_agent_cron' );
     260            wp_unschedule_event( $timestamp, 'udp_agent_cron' );
     261        }
     262    );
     263}
     264
     265// for theme.
     266add_action(
     267    'switch_theme',
    169268    function () use ( $root_dir ) {
    170269
     
    176275        // remove this agent from the list of active agents.
    177276        update_option( 'udp_installed_agents', $installed_agents );
    178         $timestamp = wp_next_scheduled( 'udp_agent_cron' );
    179         wp_unschedule_event( $timestamp, 'udp_agent_cron' );
    180     }
    181 );
    182 
    183 // for theme.
    184 add_action(
    185     'switch_theme',
    186     function () use ( $root_dir ) {
    187 
    188         $installed_agents = get_option( 'udp_installed_agents', array() );
    189         if ( isset( $installed_agents[ basename( $root_dir ) ] ) ) {
    190             unset( $installed_agents[ basename( $root_dir ) ] );
    191         }
    192 
    193         // remove this agent from the list of active agents.
    194         update_option( 'udp_installed_agents', $installed_agents );
    195     }
    196 );
     277    }
     278);
  • universal-google-adsense-and-ads-manager/trunk/languages/universal-google-adsense-and-ads-manager.pot

    r2662032 r2874094  
    1 # Copyright (C) 2019 Universal Google AdSense And Ads Manager
    2 # This file is distributed under the same license as the Universal Google AdSense And Ads Manager package.
     1# Copyright (C) 2023 themebeez
     2# This file is distributed under the GPL-2.0+.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Universal Google AdSense And Ads Manager\n"
     5"Project-Id-Version: Universal Google AdSense and Ads Manager 1.1.1\n"
     6"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/universal-google-adsense-and-ads-manager\n"
     7"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     8"Language-Team: LANGUAGE <LL@li.org>\n"
    69"MIME-Version: 1.0\n"
    710"Content-Type: text/plain; charset=UTF-8\n"
    811"Content-Transfer-Encoding: 8bit\n"
    9 "Language-Team: themebeez <themebeez@gmail.com>\n"
    10 "X-Poedit-Basepath: ..\n"
    11 "X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
    12 "X-Poedit-SearchPath-0: .\n"
    13 "X-Poedit-SearchPathExcluded-0: *.js\n"
    14 "X-Poedit-SourceCharset: UTF-8\n"
    15 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
     12"POT-Creation-Date: 2023-03-03T06:35:44+00:00\n"
     13"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
     14"X-Generator: WP-CLI 2.7.1\n"
     15"X-Domain: universal-google-adsense-and-ads-manager\n"
     16
     17#. Plugin Name of the plugin
     18msgid "Universal Google AdSense and Ads Manager"
     19msgstr ""
     20
     21#. Plugin URI of the plugin
     22msgid "https://themebeez.com/universal-google-adsense-ads-manager"
     23msgstr ""
     24
     25#. Description of the plugin
     26msgid "Universal Google AdSense and Ads Manager is a simple, and easy to use Google AdSense and custom advertisement manager for your WordPress websites."
     27msgstr ""
     28
     29#. Author of the plugin
     30msgid "themebeez"
     31msgstr ""
     32
     33#. Author URI of the plugin
     34msgid "https://themebeez.com"
     35msgstr ""
    1636
    1737#: admin/partials/ugaam-admin-display.php:26
     
    92112
    93113#: admin/partials/ugaam-admin-display.php:126
     114msgid "Ugaam Walk-through Video ..."
     115msgstr ""
     116
     117#: admin/partials/ugaam-admin-display.php:135
    94118msgid "Quick Links ..."
    95119msgstr ""
    96120
    97 #: admin/partials/ugaam-admin-display.php:129
     121#: admin/partials/ugaam-admin-display.php:138
    98122msgid "Insert Scripts"
    99123msgstr ""
    100124
    101 #: admin/partials/ugaam-admin-display.php:130
     125#: admin/partials/ugaam-admin-display.php:139
    102126msgid "Insert Ads"
    103127msgstr ""
    104128
    105 #: admin/partials/ugaam-admin-display.php:131
     129#: admin/partials/ugaam-admin-display.php:140
    106130msgid "UGAAM Documenation"
    107131msgstr ""
    108132
    109 #: admin/partials/ugaam-admin-display.php:132
     133#: admin/partials/ugaam-admin-display.php:141
    110134msgid "Get Support"
    111135msgstr ""
    112136
    113 #: admin/partials/ugaam-admin-display.php:133
     137#: admin/partials/ugaam-admin-display.php:142
    114138msgid "Rate UGAAM"
    115139msgstr ""
     
    127151msgstr ""
    128152
    129 #: includes/customizer/controls/class-customizer-responsive-dimension-control.php:66, includes/customizer/functions/customizer-choices.php:13
     153#: includes/customizer/controls/class-customizer-responsive-dimension-control.php:66
     154#: includes/customizer/functions/customizer-choices.php:13
    130155msgid "Right"
    131156msgstr ""
     
    135160msgstr ""
    136161
    137 #: includes/customizer/controls/class-customizer-responsive-dimension-control.php:66, includes/customizer/functions/customizer-choices.php:12
     162#: includes/customizer/controls/class-customizer-responsive-dimension-control.php:66
     163#: includes/customizer/functions/customizer-choices.php:12
    138164msgid "Left"
    139165msgstr ""
     
    147173msgstr ""
    148174
    149 #: includes/customizer/functions/customizer-choices.php:25, includes/widgets/class-ugaam-ad-widget.php:169
     175#: includes/customizer/functions/customizer-choices.php:25
     176#: includes/widgets/class-ugaam-ad-widget.php:169
    150177msgid "Custom Ad"
    151178msgstr ""
    152179
    153 #: includes/customizer/functions/customizer-choices.php:26, includes/widgets/class-ugaam-ad-widget.php:170
     180#: includes/customizer/functions/customizer-choices.php:26
     181#: includes/widgets/class-ugaam-ad-widget.php:170
    154182msgid "AdSense Ad"
    155183msgstr ""
     
    272300
    273301#: includes/customizer/functions/customizer-fields.php:42
    274 msgid "Universal Google AdSense &amp; Ad Manager"
     302msgid "Universal Google AdSense &amp; Ads Manager"
    275303msgstr ""
    276304
     
    299327msgstr ""
    300328
    301 #: includes/customizer/functions/customizer-fields.php:133, includes/customizer/functions/customizer-fields.php:158, includes/customizer/functions/customizer-fields.php:183, includes/customizer/functions/customizer-fields.php:208, includes/customizer/functions/customizer-fields.php:227
     329#: includes/customizer/functions/customizer-fields.php:133
     330#: includes/customizer/functions/customizer-fields.php:158
     331#: includes/customizer/functions/customizer-fields.php:183
     332#: includes/customizer/functions/customizer-fields.php:208
     333#: includes/customizer/functions/customizer-fields.php:227
    302334msgid "If you want to show same Ad on mobiles as in desktop, paste the above code below "
     335msgstr ""
     336
     337#: includes/udp/class-udp-agent.php:116
     338msgid "Allow Anonymous Tracking"
     339msgstr ""
     340
     341#: includes/udp/class-udp-agent.php:160
     342msgid "Become a super contributor by sharing your non-sensitive WordPress data. We guarantee no sensitive data is collected."
     343msgstr ""
     344
     345#: includes/udp/class-udp-agent.php:161
     346msgid " What data do we collect?"
     347msgstr ""
     348
     349#. translators: %s: agent name
     350#: includes/udp/init.php:99
     351msgid "%s is asking to allow tracking your non-sensitive WordPress data?"
     352msgstr ""
     353
     354#: includes/udp/init.php:107
     355msgid "Allow"
     356msgstr ""
     357
     358#: includes/udp/init.php:114
     359msgid "Do not show again"
     360msgstr ""
     361
     362#: includes/udp/init.php:121
     363msgid "Later"
    303364msgstr ""
    304365
  • universal-google-adsense-and-ads-manager/trunk/universal-google-adsense-and-ads-manager.php

    r2867532 r2874094  
    44 * Plugin URI:        https://themebeez.com/universal-google-adsense-ads-manager
    55 * Description:       Universal Google AdSense and Ads Manager is a simple, and easy to use Google AdSense and custom advertisement manager for your WordPress websites.
    6  * Version:           1.1.0
     6 * Version:           1.1.1
    77 * Author:            themebeez
    88 * Author URI:        https://themebeez.com
     
    2323 * Rename this for your plugin and update it as you release new versions.
    2424 */
    25 define( 'UNIVERSAL_GOOGLE_ADSENSE_AND_ADS_MANAGER_VERSION', '1.1.0' );
     25define( 'UNIVERSAL_GOOGLE_ADSENSE_AND_ADS_MANAGER_VERSION', '1.1.1' );
    2626
    2727/**
Note: See TracChangeset for help on using the changeset viewer.