Plugin Directory

Changeset 2241664


Ignore:
Timestamp:
02/10/2020 10:54:25 AM (6 years ago)
Author:
WPEka Club
Message:

Templates and minor plugin updates.

Location:
wplegalpages
Files:
92 added
13 edited

Legend:

Unmodified
Added
Removed
  • wplegalpages/trunk/README.md

    r2236364 r2241664  
    99**Requires PHP:** 5.0 
    1010**Tested up to:** 5.3.2 
    11 **Stable tag:** 2.3.8 
     11**Stable tag:** 2.3.9 
    1212
    1313Easily generate privacy policy pages on your WordPress website in a few clicks. Legal Pages for blogs, ecommerce and marketing websites.
     
    171171
    172172## Changelog ##
     173### 2.3.9 ###
     174* Update: Templates and minor plugin updates.
     175
    173176### 2.3.8 ###
    174177* Feature: Added Terms of use templates for French and German Translations.
  • wplegalpages/trunk/admin/admin-settings.php

    r2215516 r2241664  
    5858            'niche'      => '',
    5959            'pagefooter' => '',
    60             'generate'   => '1',
     60            'generate'   => '',
    6161        );
    6262
     
    8282            'address'   => isset( $_POST['lp-address'] ) ? sanitize_text_field( wp_unslash( $_POST['lp-address'] ) ) : '',
    8383            'niche'     => isset( $_POST['lp-niche'] ) ? sanitize_text_field( wp_unslash( $_POST['lp-niche'] ) ) : '',
    84             'generate'  => '1',
     84            'generate'  => isset( $_POST['lp-generate'] ) ? sanitize_text_field( wp_unslash( $_POST['lp-generate'] ) ) : '',
    8585        );
    8686        $lp_general = apply_filters( 'wplegalpages_save_settings', $lp_general, $_POST );
     
    139139            </tr>
    140140            <?php do_action( 'wplegalpages_admin_settings', $lp_general ); ?>
     141            <tr>
     142                <td><b> Give Credit : </b></td>
     143                <td><label class="switch"><input type="checkbox" <?php echo ( isset( $lp_general['generate'] ) && '1' === $lp_general['generate'] ) ? 'checked="checked"' : ''; ?> name="lp-generate" value="1" >
     144                        <div class="slider round"></div>
     145                    </label>
     146                </td>
     147            </tr>
    141148            <tr align="center">
    142149                <td colspan="3"><input type="submit" name="lp-gsubmit" class="btn btn-primary" value="Save" /> <input type="submit" class="btn btn-primary" name="lp-greset" value="Reset" /></td>
  • wplegalpages/trunk/admin/class-wp-legal-pages-admin.php

    r2236364 r2241664  
    122122         */
    123123        public function wplegal_admin_init() {
    124             $lp_db_updated          = get_option( '_lp_db_updated' );
    125             $lp_terms_updated       = get_option( '_lp_terms_updated' );
    126             $lp_terms_fr_de_updated = get_option( '_lp_terms_fr_de_updated' );
    127             if ( '1' !== $lp_db_updated || '1' !== $lp_terms_updated || '1' !== $lp_terms_fr_de_updated ) {
     124            delete_option( '_lp_db_updated' );
     125            delete_option( '_lp_terms_updated' );
     126            delete_option( '_lp_terms_fr_de_updated' );
     127            $lp_templates_updated = get_option( '_lp_templates_updated' );
     128            if ( '1' !== $lp_templates_updated ) {
    128129                global $wpdb;
    129130                $legal_pages = new WP_Legal_Pages();
    130131                require_once ABSPATH . 'wp-admin/includes/upgrade.php';
    131                 $terms_latest = file_get_contents( plugin_dir_path( dirname( __FILE__ ) ) . '/templates/Terms-of-use.html' );
    132                 $terms_fr     = file_get_contents( plugin_dir_path( dirname( __FILE__ ) ) . '/templates/Terms-of-use-fr.html' );
    133                 $terms_de     = file_get_contents( plugin_dir_path( dirname( __FILE__ ) ) . '/templates/Terms-of-use-de.html' );
    134                 $ccpa         = file_get_contents( plugin_dir_path( dirname( __FILE__ ) ) . '/templates/CCPA.html' );
    135 
     132
     133                $privacy      = file_get_contents( plugin_dir_path( dirname( __FILE__ ) ) . 'templates/privacy.html' );
     134                $dmca         = file_get_contents( plugin_dir_path( dirname( __FILE__ ) ) . 'templates/dmca.html' );
     135                $terms_latest = file_get_contents( plugin_dir_path( dirname( __FILE__ ) ) . 'templates/Terms-of-use.html' );
     136                $ccpa         = file_get_contents( plugin_dir_path( dirname( __FILE__ ) ) . 'templates/CCPA.html' );
     137                $terms_fr     = file_get_contents( plugin_dir_path( dirname( __FILE__ ) ) . 'templates/Terms-of-use-fr.html' );
     138                $terms_de     = file_get_contents( plugin_dir_path( dirname( __FILE__ ) ) . 'templates/Terms-of-use-de.html' );
     139
     140                $privacy_policy_count = $wpdb->get_var( $wpdb->prepare( 'SELECT COUNT(*) FROM ' . $legal_pages->tablename . ' WHERE title=%s', array( 'Privacy Policy' ) ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.DirectDatabaseQuery,WordPress.DB.DirectDatabaseQuery.NoCaching
     141                if ( '0' === $privacy_policy_count ) {
     142                    $wpdb->insert(
     143                        $legal_pages->tablename,
     144                        array(
     145                            'title'      => 'Privacy Policy',
     146                            'content'    => $privacy,
     147                            'contentfor' => 'kCjTeYOZxB',
     148                            'is_active'  => '1',
     149                        ),
     150                        array( '%s', '%s', '%s', '%d' )
     151                    ); // db call ok; no-cache ok.
     152                } else {
     153                    $wpdb->update(
     154                        $legal_pages->tablename,
     155                        array(
     156                            'is_active'  => '1',
     157                            'content'    => $privacy,
     158                            'contentfor' => 'kCjTeYOZxB',
     159                        ),
     160                        array( 'title' => 'Privacy Policy' ),
     161                        array( '%d', '%s', '%s' ),
     162                        array( '%s' )
     163                    ); // db call ok; no-cache ok.
     164                }
     165                $dmca_count = $wpdb->get_var( $wpdb->prepare( 'SELECT COUNT(*) FROM ' . $legal_pages->tablename . ' WHERE title=%s', array( 'DMCA' ) ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.DirectDatabaseQuery,WordPress.DB.DirectDatabaseQuery.NoCaching
     166                if ( '0' === $dmca_count ) {
     167                    $wpdb->insert(
     168                        $legal_pages->tablename,
     169                        array(
     170                            'title'      => 'DMCA',
     171                            'content'    => $dmca,
     172                            'contentfor' => '1r4X6y8tssz0j',
     173                            'is_active'  => '1',
     174                        ),
     175                        array( '%s', '%s', '%s', '%d' )
     176                    ); // db call ok; no-cache ok.
     177                } else {
     178                    $wpdb->update(
     179                        $legal_pages->tablename,
     180                        array(
     181                            'is_active'  => '1',
     182                            'content'    => $dmca,
     183                            'contentfor' => 'r4X6y8tssz',
     184                        ),
     185                        array( 'title' => 'DMCA' ),
     186                        array( '%d', '%s', '%s' ),
     187                        array( '%s' )
     188                    ); // db call ok; no-cache ok.
     189                }
    136190                $terms_of_use_count = $wpdb->get_var( $wpdb->prepare( 'SELECT COUNT(*) FROM ' . $legal_pages->tablename . ' WHERE title=%s', array( 'Terms of Use' ) ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.DirectDatabaseQuery,WordPress.DB.DirectDatabaseQuery.NoCaching
    137191                if ( '0' === $terms_of_use_count ) {
     
    141195                            'title'      => 'Terms of Use',
    142196                            'content'    => $terms_latest,
    143                             'contentfor' => '1a2b3c4d5e6f7g8h9i',
    144                             'is_active'  => '1',
    145                         ),
    146                         array( '%s', '%s', '%s', '%d' )
    147                     );
    148                 } else {
    149                     $wpdb->update(
    150                         $legal_pages->tablename,
    151                         array(
    152                             'is_active' => '1',
    153                             'content'   => $terms_latest,
     197                            'contentfor' => 'n1bmPjZ6Xj',
     198                            'is_active'  => '1',
     199                        ),
     200                        array( '%s', '%s', '%s', '%d' )
     201                    );
     202                } else {
     203                    $wpdb->update(
     204                        $legal_pages->tablename,
     205                        array(
     206                            'is_active'  => '1',
     207                            'content'    => $terms_latest,
     208                            'contentfor' => 'n1bmPjZ6Xj',
    154209                        ),
    155210                        array( 'title' => 'Terms of Use' ),
     211                        array( '%d', '%s', '%s' ),
     212                        array( '%s' )
     213                    ); // db call ok; no-cache ok.
     214                }
     215                $terms_of_use_fr_count = $wpdb->get_var( $wpdb->prepare( 'SELECT COUNT(*) FROM ' . $legal_pages->tablename . ' WHERE title=%s', array( 'Terms of Use - FR' ) ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.DirectDatabaseQuery,WordPress.DB.DirectDatabaseQuery.NoCaching
     216                if ( '0' === $terms_of_use_fr_count ) {
     217                    $wpdb->insert( // phpcs:ignore WordPress.DB.DirectDatabaseQuery
     218                        $legal_pages->tablename,
     219                        array(
     220                            'title'      => 'Terms of Use - FR',
     221                            'content'    => $terms_fr,
     222                            'contentfor' => 'MMFqUJfC3m',
     223                            'is_active'  => '1',
     224                        ),
     225                        array( '%s', '%s', '%s', '%d' )
     226                    );
     227                } else {
     228                    $wpdb->update(
     229                        $legal_pages->tablename,
     230                        array(
     231                            'is_active'  => '1',
     232                            'content'    => $terms_fr,
     233                            'contentfor' => 'MMFqUJfC3m',
     234                        ),
     235                        array( 'title' => 'Terms of Use - FR' ),
     236                        array( '%d', '%s', '%s' ),
     237                        array( '%s' )
     238                    ); // db call ok; no-cache ok.
     239                }
     240                $terms_of_use_de_count = $wpdb->get_var( $wpdb->prepare( 'SELECT COUNT(*) FROM ' . $legal_pages->tablename . ' WHERE title=%s', array( 'Terms of Use - DE' ) ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.DirectDatabaseQuery,WordPress.DB.DirectDatabaseQuery.NoCaching
     241                if ( '0' === $terms_of_use_de_count ) {
     242                    $wpdb->insert( // phpcs:ignore WordPress.DB.DirectDatabaseQuery
     243                        $legal_pages->tablename,
     244                        array(
     245                            'title'      => 'Terms of Use - DE',
     246                            'content'    => $terms_de,
     247                            'contentfor' => 'fbBlC5Y4yZ',
     248                            'is_active'  => '1',
     249                        ),
     250                        array( '%s', '%s', '%s', '%d' )
     251                    );
     252                } else {
     253                    $wpdb->update(
     254                        $legal_pages->tablename,
     255                        array(
     256                            'is_active'  => '1',
     257                            'content'    => $terms_de,
     258                            'contentfor' => 'fbBlC5Y4yZ',
     259                        ),
     260                        array( 'title' => 'Terms of Use - DE' ),
    156261                        array( '%d', '%s' ),
    157262                        array( '%s' )
     
    213318                            'title'      => 'CCPA - California Consumer Privacy Act',
    214319                            'content'    => $ccpa,
    215                             'contentfor' => '5a5b5c5d5e',
    216                             'is_active'  => '1',
    217                         ),
    218                         array( '%s', '%s', '%s', '%d' )
    219                     );
    220                 } else {
    221                     $wpdb->update(
    222                         $legal_pages->tablename,
    223                         array(
    224                             'is_active' => '1',
    225                             'content'   => $ccpa,
     320                            'contentfor' => 'JRevVk8nkP',
     321                            'is_active'  => '1',
     322                        ),
     323                        array( '%s', '%s', '%s', '%d' )
     324                    );
     325                } else {
     326                    $wpdb->update(
     327                        $legal_pages->tablename,
     328                        array(
     329                            'is_active'  => '1',
     330                            'content'    => $ccpa,
     331                            'contentfor' => 'JRevVk8nkP',
    226332                        ),
    227333                        array( 'title' => 'CCPA - California Consumer Privacy Act' ),
    228                         array( '%d', '%s' ),
    229                         array( '%s' )
    230                     ); // db call ok; no-cache ok.
    231                 }
    232                 $lp_general = get_option( 'lp_general' );
    233                 if ( isset( $lp_general ) && ! empty( $lp_general ) ) {
    234                     $lp_general['generate'] = '1';
    235                 } else {
    236                     $lp_general             = array();
    237                     $lp_general['generate'] = '1';
    238                 }
    239                 update_option( 'lp_general', $lp_general );
    240                 update_option( '_lp_db_updated', true );
    241                 update_option( '_lp_terms_updated', true );
    242                 update_option( '_lp_terms_fr_de_updated', true );
     334                        array( '%d', '%s', '%s' ),
     335                        array( '%s' )
     336                    ); // db call ok; no-cache ok.
     337                }
     338                update_option( '_lp_templates_updated', true );
    243339            }
    244 
    245340        }
    246341
  • wplegalpages/trunk/includes/class-wp-legal-pages-activator.php

    r2236364 r2241664  
    7373            $privacy      = file_get_contents( plugin_dir_path( dirname( __FILE__ ) ) . 'templates/privacy.html' );
    7474            $dmca         = file_get_contents( plugin_dir_path( dirname( __FILE__ ) ) . 'templates/dmca.html' );
    75             $terms_latest = file_get_contents( plugin_dir_path( dirname( __FILE__ ) ) . '/templates/Terms-of-use.html' );
    76             $ccpa         = file_get_contents( plugin_dir_path( dirname( __FILE__ ) ) . '/templates/CCPA.html' );
    77             $terms_fr     = file_get_contents( plugin_dir_path( dirname( __FILE__ ) ) . '/templates/Terms-of-use-fr.html' );
    78             $terms_de     = file_get_contents( plugin_dir_path( dirname( __FILE__ ) ) . '/templates/Terms-of-use-de.html' );
     75            $terms_latest = file_get_contents( plugin_dir_path( dirname( __FILE__ ) ) . 'templates/Terms-of-use.html' );
     76            $ccpa         = file_get_contents( plugin_dir_path( dirname( __FILE__ ) ) . 'templates/CCPA.html' );
     77            $terms_fr     = file_get_contents( plugin_dir_path( dirname( __FILE__ ) ) . 'templates/Terms-of-use-fr.html' );
     78            $terms_de     = file_get_contents( plugin_dir_path( dirname( __FILE__ ) ) . 'templates/Terms-of-use-de.html' );
    7979
    8080            $privacy_policy_count = $wpdb->get_var( $wpdb->prepare( 'SELECT COUNT(*) FROM ' . $legal_pages->tablename . ' WHERE title=%s', array( 'Privacy Policy' ) ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.DirectDatabaseQuery,WordPress.DB.DirectDatabaseQuery.NoCaching
     
    8585                        'title'      => 'Privacy Policy',
    8686                        'content'    => $privacy,
    87                         'contentfor' => '1a2b3c4d5e6f7g8h9i',
    88                         'is_active'  => '1',
    89                     ),
    90                     array( '%s', '%s', '%s', '%d' )
    91                 ); // db call ok; no-cache ok.
    92             } else {
    93                 $wpdb->update(
    94                     $legal_pages->tablename,
    95                     array(
    96                         'is_active' => '1',
    97                         'content'   => $privacy,
     87                        'contentfor' => 'kCjTeYOZxB',
     88                        'is_active'  => '1',
     89                    ),
     90                    array( '%s', '%s', '%s', '%d' )
     91                ); // db call ok; no-cache ok.
     92            } else {
     93                $wpdb->update(
     94                    $legal_pages->tablename,
     95                    array(
     96                        'is_active'  => '1',
     97                        'content'    => $privacy,
     98                        'contentfor' => 'kCjTeYOZxB',
    9899                    ),
    99100                    array( 'title' => 'Privacy Policy' ),
    100                     array( '%d', '%s' ),
     101                    array( '%d', '%s', '%s' ),
    101102                    array( '%s' )
    102103                ); // db call ok; no-cache ok.
     
    109110                        'title'      => 'DMCA',
    110111                        'content'    => $dmca,
    111                         'contentfor' => '10j',
    112                         'is_active'  => '1',
    113                     ),
    114                     array( '%s', '%s', '%s', '%d' )
    115                 ); // db call ok; no-cache ok.
    116             } else {
    117                 $wpdb->update(
    118                     $legal_pages->tablename,
    119                     array(
    120                         'is_active' => '1',
    121                         'content'   => $dmca,
     112                        'contentfor' => '1r4X6y8tssz0j',
     113                        'is_active'  => '1',
     114                    ),
     115                    array( '%s', '%s', '%s', '%d' )
     116                ); // db call ok; no-cache ok.
     117            } else {
     118                $wpdb->update(
     119                    $legal_pages->tablename,
     120                    array(
     121                        'is_active'  => '1',
     122                        'content'    => $dmca,
     123                        'contentfor' => 'r4X6y8tssz',
    122124                    ),
    123125                    array( 'title' => 'DMCA' ),
    124                     array( '%d', '%s' ),
     126                    array( '%d', '%s', '%s' ),
    125127                    array( '%s' )
    126128                ); // db call ok; no-cache ok.
     
    133135                        'title'      => 'Terms of Use',
    134136                        'content'    => $terms_latest,
    135                         'contentfor' => '1a2b3c4d5e6f7g8h9i',
    136                         'is_active'  => '1',
    137                     ),
    138                     array( '%s', '%s', '%s', '%d' )
    139                 );
    140             } else {
    141                 $wpdb->update(
    142                     $legal_pages->tablename,
    143                     array(
    144                         'is_active' => '1',
    145                         'content'   => $terms_latest,
     137                        'contentfor' => 'n1bmPjZ6Xj',
     138                        'is_active'  => '1',
     139                    ),
     140                    array( '%s', '%s', '%s', '%d' )
     141                );
     142            } else {
     143                $wpdb->update(
     144                    $legal_pages->tablename,
     145                    array(
     146                        'is_active'  => '1',
     147                        'content'    => $terms_latest,
     148                        'contentfor' => 'n1bmPjZ6Xj',
    146149                    ),
    147150                    array( 'title' => 'Terms of Use' ),
     151                    array( '%d', '%s', '%s' ),
     152                    array( '%s' )
     153                ); // db call ok; no-cache ok.
     154            }
     155            $terms_of_use_fr_count = $wpdb->get_var( $wpdb->prepare( 'SELECT COUNT(*) FROM ' . $legal_pages->tablename . ' WHERE title=%s', array( 'Terms of Use - FR' ) ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.DirectDatabaseQuery,WordPress.DB.DirectDatabaseQuery.NoCaching
     156            if ( '0' === $terms_of_use_fr_count ) {
     157                $wpdb->insert( // phpcs:ignore WordPress.DB.DirectDatabaseQuery
     158                    $legal_pages->tablename,
     159                    array(
     160                        'title'      => 'Terms of Use - FR',
     161                        'content'    => $terms_fr,
     162                        'contentfor' => 'MMFqUJfC3m',
     163                        'is_active'  => '1',
     164                    ),
     165                    array( '%s', '%s', '%s', '%d' )
     166                );
     167            } else {
     168                $wpdb->update(
     169                    $legal_pages->tablename,
     170                    array(
     171                        'is_active'  => '1',
     172                        'content'    => $terms_fr,
     173                        'contentfor' => 'MMFqUJfC3m',
     174                    ),
     175                    array( 'title' => 'Terms of Use - FR' ),
     176                    array( '%d', '%s', '%s' ),
     177                    array( '%s' )
     178                ); // db call ok; no-cache ok.
     179            }
     180            $terms_of_use_de_count = $wpdb->get_var( $wpdb->prepare( 'SELECT COUNT(*) FROM ' . $legal_pages->tablename . ' WHERE title=%s', array( 'Terms of Use - DE' ) ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.DirectDatabaseQuery,WordPress.DB.DirectDatabaseQuery.NoCaching
     181            if ( '0' === $terms_of_use_de_count ) {
     182                $wpdb->insert( // phpcs:ignore WordPress.DB.DirectDatabaseQuery
     183                    $legal_pages->tablename,
     184                    array(
     185                        'title'      => 'Terms of Use - DE',
     186                        'content'    => $terms_de,
     187                        'contentfor' => 'fbBlC5Y4yZ',
     188                        'is_active'  => '1',
     189                    ),
     190                    array( '%s', '%s', '%s', '%d' )
     191                );
     192            } else {
     193                $wpdb->update(
     194                    $legal_pages->tablename,
     195                    array(
     196                        'is_active'  => '1',
     197                        'content'    => $terms_de,
     198                        'contentfor' => 'fbBlC5Y4yZ',
     199                    ),
     200                    array( 'title' => 'Terms of Use - DE' ),
    148201                    array( '%d', '%s' ),
    149202                    array( '%s' )
     
    205258                        'title'      => 'CCPA - California Consumer Privacy Act',
    206259                        'content'    => $ccpa,
    207                         'contentfor' => '5a5b5c5d5e',
    208                         'is_active'  => '1',
    209                     ),
    210                     array( '%s', '%s', '%s', '%d' )
    211                 );
    212             } else {
    213                 $wpdb->update(
    214                     $legal_pages->tablename,
    215                     array(
    216                         'is_active' => '1',
    217                         'content'   => $ccpa,
     260                        'contentfor' => 'JRevVk8nkP',
     261                        'is_active'  => '1',
     262                    ),
     263                    array( '%s', '%s', '%s', '%d' )
     264                );
     265            } else {
     266                $wpdb->update(
     267                    $legal_pages->tablename,
     268                    array(
     269                        'is_active'  => '1',
     270                        'content'    => $ccpa,
     271                        'contentfor' => 'JRevVk8nkP',
    218272                    ),
    219273                    array( 'title' => 'CCPA - California Consumer Privacy Act' ),
    220                     array( '%d', '%s' ),
    221                     array( '%s' )
    222                 ); // db call ok; no-cache ok.
    223             }
    224             add_option( '_lp_db_updated', true );
    225             add_option( '_lp_terms_updated', true );
    226             add_option( '_lp_terms_fr_de_updated', true );
     274                    array( '%d', '%s', '%s' ),
     275                    array( '%s' )
     276                ); // db call ok; no-cache ok.
     277            }
     278
     279            delete_option( '_lp_db_updated' );
     280            delete_option( '_lp_terms_updated' );
     281            delete_option( '_lp_terms_fr_de_updated' );
     282            add_option( '_lp_templates_updated', true );
    227283            add_option( 'lp_excludePage', 'true' );
    228284            add_option( 'lp_general', '' );
     
    242298            add_option( 'lp_eu_link_color', '#8f0410' );
    243299            add_option( 'lp_eu_text_size', '12' );
    244             $lp_general = get_option( 'lp_general' );
    245             if ( isset( $lp_general ) && ! empty( $lp_general ) ) {
    246                 $lp_general['generate'] = '1';
    247             } else {
    248                 $lp_general             = array();
    249                 $lp_general['generate'] = '1';
    250             }
    251             update_option( 'lp_general', $lp_general );
    252300        }
    253301    }
  • wplegalpages/trunk/includes/class-wp-legal-pages-deactivator.php

    r2215516 r2241664  
    4141        public static function deactivate() {
    4242            delete_option( '_lp_db_updated' );
     43            delete_option( '_lp_terms_updated' );
     44            delete_option( '_lp_terms_fr_de_updated' );
    4345            delete_option( 'lp_accept_terms' );
    4446        }
  • wplegalpages/trunk/includes/class-wp-legal-pages.php

    r2236364 r2241664  
    8686            global $table_prefix;
    8787            $this->plugin_name = 'wp-legal-pages';
    88             $this->version     = '2.3.8';
     88            $this->version     = '2.3.9';
    8989            $this->tablename   = $table_prefix . 'legal_pages';
    9090            $this->popuptable  = $table_prefix . 'lp_popups';
     
    9292            $this->load_dependencies();
    9393            $this->set_locale();
    94             if ( is_admin() ) {
     94            if ( $this->is_request( 'admin' ) ) {
    9595                $this->define_admin_hooks();
     96            } elseif ( $this->is_request( 'frontend' ) ) {
     97                $this->define_public_hooks();
    9698            }
    97             $this->define_public_hooks();
     99        }
     100
     101        /**
     102         * What type of request is this?
     103         *
     104         * @since 2.3.9
     105         * @param  string $type admin, ajax, cron or frontend.
     106         * @return bool
     107         */
     108        private function is_request( $type ) {
     109            switch ( $type ) {
     110                case 'admin':
     111                    return is_admin();
     112                case 'ajax':
     113                    return defined( 'DOING_AJAX' );
     114                case 'cron':
     115                    return defined( 'DOING_CRON' );
     116                case 'frontend':
     117                    return ( ! is_admin() || defined( 'DOING_AJAX' ) ) && ! defined( 'DOING_CRON' ) && ! defined( 'REST_REQUEST' );
     118            }
    98119        }
    99120
  • wplegalpages/trunk/public/class-wp-legal-pages-public.php

    r2215516 r2241664  
    119119                $is_legal = get_post_meta( $post->ID, 'is_legal', true );
    120120                if ( isset( $is_legal ) && 'yes' === $is_legal ) {
    121                     $generate_text = "<div style='font-size: 0.7em;'><i>Policy generated by <a href='https://club.wpeka.com/product/wplegalpages/?utm_source=generated-page&utm_medium=credit-link' rel='nofollow' target='_blank'>WP Legal Pages</a></i></div>";
     121                    $generate_text = "<div style='font-size: 0.7em;'><i>" . get_the_title( $post ) . " generated by <a href='https://club.wpeka.com/product/wplegalpages/?utm_source=generated-page&utm_medium=credit-link' rel='nofollow' target='_blank'>WP Legal Pages</a></i></div>";
    122122                    $content       = $content . $generate_text;
    123123                }
  • wplegalpages/trunk/readme.txt

    r2236364 r2241664  
    99Requires PHP: 5.0
    1010Tested up to: 5.3.2
    11 Stable tag: 2.3.8
     11Stable tag: 2.3.9
    1212
    1313Easily generate privacy policy pages on your WordPress website in a few clicks. Legal Pages for blogs, ecommerce and marketing websites.
     
    171171
    172172== Changelog ==
     173= 2.3.9 =
     174* Update: Templates and minor plugin updates.
     175
    173176= 2.3.8 =
    174177* Feature: Added Terms of use templates for French and German Translations.
  • wplegalpages/trunk/templates/Terms-latest.html

    r2215516 r2241664  
    1 <h2>TERMS OF USE</h2>
    21<p>PLEASE READ! [Domain] REQUIRES CONSIDERATION FOR AND AS A CONDITION OF ALLOWING YOUR USE OF [Domain].</p>
    32<p>BY ACCESSING OR USING THIS SITE YOU REPRESENT THAT YOU HAVE THE FULL AUTHORITY TO ACT TO BIND YOURSELF, ANY THIRD PARTY, COMPANY, OR LEGAL ENTITY, AND THAT YOUR USE AND/OR INTERACTION, AS WELL AS CONTINUING TO USE OR INTERACT, WITH THE SITE CONSTITUTES YOUR HAVING READ AND AGREED TO THESE TERMS OF USE AS WELL AS OTHER AGREEMENTS THAT WE MAY POST ON THE SITE.</p>
  • wplegalpages/trunk/templates/Terms-of-use.html

    r2218628 r2241664  
    1 <h2>TERMS OF USE</h2>
    21<p>These Terms govern your access to, usage of all content, Product and Services available at [Domain] website (the “Service”) operated by [Business Name] (“us”, “we”, or “our”).</p>
    32<p>Your access to our services are subject to your acceptance, without modification, of all of the terms and conditions contained herein and all other operating rules and policies published and that may be published from time to time by us.</p>
  • wplegalpages/trunk/templates/privacy.html

    r2165603 r2241664  
    1 <h2>Privacy Policy</h2>
    21<p>Welcome to [Domain] (the "Site"). We understand that privacy online is important to users of our Site, especially when conducting business. This statement governs our privacy policies with respect to those users of the Site ("Visitors") who visit without transacting business and Visitors who register to transact business on the Site and make use of the various services offered by [Business Name] (collectively, "Services") ("Authorized Customers").</p>
    32<strong>"Personally Identifiable Information"</strong>
  • wplegalpages/trunk/wplegalpages.php

    r2236364 r2241664  
    55 * Description: WP Legal Pages is a simple 1 click legal page management plugin. You can quickly add in legal pages to your WordPress sites.
    66 * Author: WPEka Club
    7  * Version: 2.3.8
     7 * Version: 2.3.9
    88 * Author URI: https://club.wpeka.com
    99 * License: GPL2
     
    4242                    'product_name'    => 'WP Legal Pages',
    4343                    'module_type'     => 'plugin',
    44                     'version'         => '2.3.8',
     44                    'version'         => '2.3.9',
    4545                    'plugin_basename' => 'wplegalpages/wplegalpages.php',
    4646                    'plugin_url'      => WPL_LITE_PLUGIN_URL,
Note: See TracChangeset for help on using the changeset viewer.