Changeset 3238736
- Timestamp:
- 02/11/2025 05:23:36 PM (14 months ago)
- Location:
- affiliate-links
- Files:
-
- 94 added
- 10 edited
-
tags/3.1.0 (added)
-
tags/3.1.0/admin (added)
-
tags/3.1.0/admin/class-affiliate-links-buttons.php (added)
-
tags/3.1.0/admin/class-affiliate-links-metabox.php (added)
-
tags/3.1.0/admin/class-affiliate-links-settings.php (added)
-
tags/3.1.0/admin/css (added)
-
tags/3.1.0/admin/css/affiliate-links-admin.css (added)
-
tags/3.1.0/admin/css/index.php (added)
-
tags/3.1.0/admin/images (added)
-
tags/3.1.0/admin/images/index.php (added)
-
tags/3.1.0/admin/images/logo-affiliate-links.png (added)
-
tags/3.1.0/admin/images/logo-teamdev.png (added)
-
tags/3.1.0/admin/index.php (added)
-
tags/3.1.0/admin/js (added)
-
tags/3.1.0/admin/js/affiliate-links-admin.js (added)
-
tags/3.1.0/admin/js/affiliate-links-button.js (added)
-
tags/3.1.0/admin/js/affiliate-links-qtags.js (added)
-
tags/3.1.0/admin/js/index.php (added)
-
tags/3.1.0/admin/partials (added)
-
tags/3.1.0/admin/partials/index.php (added)
-
tags/3.1.0/admin/partials/metabox-embed.php (added)
-
tags/3.1.0/admin/partials/metabox-sidebar.php (added)
-
tags/3.1.0/admin/partials/settings-docs.php (added)
-
tags/3.1.0/admin/partials/settings-faq.php (added)
-
tags/3.1.0/admin/partials/settings-go-premium.php (added)
-
tags/3.1.0/admin/partials/settings-nav-tabs.php (added)
-
tags/3.1.0/admin/partials/settings-sidebar.php (added)
-
tags/3.1.0/admin/partials/wysiwyg-button-dialog.php (added)
-
tags/3.1.0/affiliate-links.php (added)
-
tags/3.1.0/includes (added)
-
tags/3.1.0/includes/affiliate-links-iframe.php (added)
-
tags/3.1.0/includes/class-affiliate-links-shortcode.php (added)
-
tags/3.1.0/includes/class-affiliate-links.php (added)
-
tags/3.1.0/includes/index.php (added)
-
tags/3.1.0/index.php (added)
-
tags/3.1.0/languages (added)
-
tags/3.1.0/languages/affiliate-links-en_US.mo (added)
-
tags/3.1.0/languages/affiliate-links-en_US.po (added)
-
tags/3.1.0/languages/index.php (added)
-
tags/3.1.0/languages/trunk.pot (added)
-
tags/3.1.0/languages/wp-plugin-affiliate-links.pot (added)
-
tags/3.1.0/license.txt (added)
-
tags/3.1.0/pro (added)
-
tags/3.1.0/pro/class-affiliate-links-pro-base.php (added)
-
tags/3.1.0/pro/class-affiliate-links-pro-import-export.php (added)
-
tags/3.1.0/pro/class-affiliate-links-pro-install.php (added)
-
tags/3.1.0/pro/class-affiliate-links-pro-metabox.php (added)
-
tags/3.1.0/pro/class-affiliate-links-pro-replacer.php (added)
-
tags/3.1.0/pro/class-affiliate-links-pro-report-table.php (added)
-
tags/3.1.0/pro/class-affiliate-links-pro-settings.php (added)
-
tags/3.1.0/pro/class-affiliate-links-pro-shortcodes.php (added)
-
tags/3.1.0/pro/class-affiliate-links-pro-stats.php (added)
-
tags/3.1.0/pro/class-affiliate-links-pro-widgets.php (added)
-
tags/3.1.0/pro/class-affiliate-links-pro.php (added)
-
tags/3.1.0/pro/css (added)
-
tags/3.1.0/pro/css/admin-af-links-pro.css (added)
-
tags/3.1.0/pro/css/index.php (added)
-
tags/3.1.0/pro/css/jquery.jqplot.css (added)
-
tags/3.1.0/pro/index.php (added)
-
tags/3.1.0/pro/js (added)
-
tags/3.1.0/pro/js/admin-af-links-pro.js (added)
-
tags/3.1.0/pro/js/front-af-links-pro.js (added)
-
tags/3.1.0/pro/js/index.php (added)
-
tags/3.1.0/pro/js/jqplot.canvasAxisLabelRenderer.js (added)
-
tags/3.1.0/pro/js/jqplot.canvasTextRenderer.js (added)
-
tags/3.1.0/pro/js/jqplot.dateAxisRenderer.js (added)
-
tags/3.1.0/pro/js/jqplot.donutRenderer.js (added)
-
tags/3.1.0/pro/js/jqplot.pieRenderer.js (added)
-
tags/3.1.0/pro/js/jquery.jqplot.js (added)
-
tags/3.1.0/pro/js/jquery.mask.js (added)
-
tags/3.1.0/pro/js/jquery.repeater.js (added)
-
tags/3.1.0/pro/vendors (added)
-
tags/3.1.0/pro/vendors/RandomColor.php (added)
-
tags/3.1.0/pro/vendors/index.php (added)
-
tags/3.1.0/pro/views (added)
-
tags/3.1.0/pro/views/html-additional-settings.php (added)
-
tags/3.1.0/pro/views/html-admin-reports-link-info.php (added)
-
tags/3.1.0/pro/views/html-admin-reports-range.php (added)
-
tags/3.1.0/pro/views/html-admin-reports.php (added)
-
tags/3.1.0/pro/views/html-browser-by-date.php (added)
-
tags/3.1.0/pro/views/html-link-by-date.php (added)
-
tags/3.1.0/pro/views/html-link-cat-by-date.php (added)
-
tags/3.1.0/pro/views/html-link-express.php (added)
-
tags/3.1.0/pro/views/html-link-replacer.php (added)
-
tags/3.1.0/pro/views/html-links-by-date.php (added)
-
tags/3.1.0/pro/views/index.php (added)
-
tags/3.1.0/pro/widgets (added)
-
tags/3.1.0/pro/widgets/class-affiliate-links-widget-popular-links.php (added)
-
tags/3.1.0/pro/widgets/class-affiliate-links-widget-recent-links.php (added)
-
tags/3.1.0/pro/widgets/index.php (added)
-
tags/3.1.0/readme.txt (added)
-
tags/3.1.0/uninstall.php (added)
-
trunk/admin/class-affiliate-links-metabox.php (modified) (1 diff)
-
trunk/admin/class-affiliate-links-settings.php (modified) (1 diff)
-
trunk/includes/class-affiliate-links.php (modified) (2 diffs)
-
trunk/languages/trunk.pot (added)
-
trunk/languages/wp-plugin-affiliate-links.pot (added)
-
trunk/pro/class-affiliate-links-pro-import-export.php (modified) (2 diffs)
-
trunk/pro/class-affiliate-links-pro-metabox.php (modified) (1 diff)
-
trunk/pro/class-affiliate-links-pro-replacer.php (modified) (4 diffs)
-
trunk/pro/class-affiliate-links-pro-stats.php (modified) (2 diffs)
-
trunk/pro/class-affiliate-links-pro.php (modified) (2 diffs)
-
trunk/pro/js/admin-af-links-pro.js (modified) (1 diff)
-
trunk/pro/views/html-additional-settings.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
affiliate-links/trunk/admin/class-affiliate-links-metabox.php
r3234074 r3238736 115 115 public function hide_yoast_columns( $columns ) { 116 116 117 if ( ! current_user_can( 'manage_options' ) ) { 118 return $columns; 119 } 120 117 121 unset( $columns['wpseo-score'] ); 118 122 unset( $columns['wpseo-title'] ); -
affiliate-links/trunk/admin/class-affiliate-links-settings.php
r3234074 r3238736 341 341 public function flush_rules() { 342 342 343 if (isset( $_GET['settings-updated'] ) ) {344 flush_rewrite_rules();345 }343 if ( current_user_can( 'manage_options' ) && isset( $_GET['settings-updated'] ) ) { 344 flush_rewrite_rules(); 345 } 346 346 347 347 } -
affiliate-links/trunk/includes/class-affiliate-links.php
r3150755 r3238736 4 4 die(); 5 5 } 6 7 // Include pluggable.php to ensure wp_get_current_user() is available 8 if ( ! function_exists( 'wp_get_current_user' ) ) { 9 require_once ABSPATH . 'wp-includes/pluggable.php'; 10 } 11 6 12 /** 7 13 * The Affiliate Links Core Plugin Class. … … 31 37 new Affiliate_Links_Settings(); 32 38 33 if ( is_admin() ) {39 if ( current_user_can( 'manage_options' ) ) { 34 40 require_once AFFILIATE_LINKS_PLUGIN_DIR . 'admin/class-affiliate-links-metabox.php'; 35 41 require_once AFFILIATE_LINKS_PLUGIN_DIR . 'admin/class-affiliate-links-buttons.php'; -
affiliate-links/trunk/pro/class-affiliate-links-pro-import-export.php
r3150755 r3238736 16 16 add_action( 'init', array( $this, 'maybe_export' ) ); 17 17 add_action( 'init', array( $this, 'maybe_import' ) ); 18 if ( is_admin() ) {18 if ( current_user_can( 'manage_options' ) ) { 19 19 add_action( 'admin_menu', array( $this, 'add_menu' ) ); 20 20 } … … 32 32 33 33 public function maybe_import() { 34 if ( isset( $_POST[ 'file_nonce' ] ) && isset( $_FILES[ 'file'] ) ) {34 if ( current_user_can( 'manage_options' ) && isset( $_POST['file_nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['file_nonce'] ) ), 'import' ) && isset( $_FILES['file'] ) ) { 35 35 $this->import(); 36 36 } 37 37 } 38 38 39 public function maybe_export() { 39 if ( isset( $_POST[ 'export_nonce' ]) ) {40 if ( current_user_can( 'manage_options' ) && isset( $_POST['export_nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['export_nonce'] ) ), 'export' ) ) { 40 41 $this->export(); 41 42 } -
affiliate-links/trunk/pro/class-affiliate-links-pro-metabox.php
r3150755 r3238736 126 126 127 127 128 /** 129 * Retrieve the browser links data stored in post meta. 130 * The data is stored as JSON, so we decode it safely here. 131 * 132 * @param string|int $id Optional post ID. 133 * 134 * @return array Decoded link data or empty array. 135 */ 128 136 public function get_browser_links( $id = '' ) { 129 137 global $post; 130 138 $post_id = $id ? $id : $post->ID; 131 $data = get_post_meta( $post_id, $this->browser_link_meta_key ); 132 if ( count( $data ) ) { 133 $data = maybe_unserialize( current( $data ) ); 139 140 // Retrieve raw JSON from post meta 141 $data = get_post_meta( $post_id, $this->browser_link_meta_key, true ); 142 143 if ( empty( $data ) ) { 144 return array(); 134 145 } 135 146 136 return $data; 147 // Decode JSON 148 $decoded = json_decode( $data, true ); 149 150 if ( json_last_error() === JSON_ERROR_NONE && is_array( $decoded ) ) { 151 return $decoded; 152 } 153 154 return array(); // Return empty if JSON is invalid 137 155 } 138 156 -
affiliate-links/trunk/pro/class-affiliate-links-pro-replacer.php
r3150755 r3238736 5 5 } 6 6 include_once AFFILIATE_LINKS_PRO_PLUGIN_DIR . '/' . 'class-affiliate-links-pro-base.php'; 7 8 // Include pluggable.php to ensure wp_get_current_user() is available 9 if ( ! function_exists( 'wp_get_current_user' ) ) { 10 require_once ABSPATH . 'wp-includes/pluggable.php'; 11 } 7 12 8 13 class Affiliate_Links_Pro_Replacer extends Affiliate_Links_Pro_Base { … … 15 20 parent::__construct(); 16 21 17 if ( is_admin() ) {22 if ( current_user_can( 'manage_options' ) ) { 18 23 add_action( 'admin_menu', array( $this, 'add_menu' ) ); 19 24 } … … 32 37 33 38 public function controller() { 34 35 if ( isset( $_POST['replace_links_nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['replace_links_nonce'] ) ), 'replace_links' ) ) { 39 if ( current_user_can( 'manage_options' ) && isset( $_POST['replace_links_nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['replace_links_nonce'] ) ), 'replace_links' ) ) { 36 40 $this->current_link = isset( $_POST['current-link'] ) ? esc_url_raw( $_POST['current-link'] ) : ''; 37 41 $this->new_link = isset( $_POST['new-link'] ) ? esc_url_raw( $_POST['new-link'] ) : ''; … … 41 45 $this->render_view( $this->template ); 42 46 } 43 44 47 45 48 public function replace_link( $current_link, $new_link ) { -
affiliate-links/trunk/pro/class-affiliate-links-pro-stats.php
r3150755 r3238736 4 4 die(); 5 5 } 6 7 // Include pluggable.php to ensure wp_get_current_user() is available 8 if ( ! function_exists( 'wp_get_current_user' ) ) { 9 require_once ABSPATH . 'wp-includes/pluggable.php'; 10 } 11 6 12 include_once AFFILIATE_LINKS_PRO_PLUGIN_DIR . '/' . 'class-affiliate-links-pro-base.php'; 7 13 … … 31 37 ) ); 32 38 33 if ( is_admin() ) {39 if ( current_user_can( 'manage_options' ) ) { 34 40 add_action( 'admin_menu', array( $this, 'add_menu' ) ); 35 41 add_action( 'current_screen', array( $this, 'is_screen' ) ); -
affiliate-links/trunk/pro/class-affiliate-links-pro.php
r3150755 r3238736 78 78 'ajax_url' => admin_url( 'admin-ajax.php' ), 79 79 'action' => 'af_link_additional_settings', 80 'security' => wp_create_nonce( 'af_link_additional_settings' ), 80 81 ) ); 81 82 … … 86 87 87 88 public function get_additional_settings() { 88 if ( isset( $_REQUEST[ 'name' ] ) && FALSE === empty( $_REQUEST[ 'name' ]) ) {89 foreach ( $this->custom_target_url_metabox->get_custom_target_url_values( $_REQUEST[ 'name' ]) as $value => $label ) {89 if ( isset( $_REQUEST['name'] ) && ! empty( $_REQUEST['name'] ) && check_ajax_referer( 'af_link_additional_settings', 'security' ) ) { 90 foreach ( $this->custom_target_url_metabox->get_custom_target_url_values( sanitize_text_field( wp_unslash( $_REQUEST['name'] ) ) ) as $value => $label ) { 90 91 ?> 91 92 <option value="<?php echo esc_attr( $value ) ?>"><?php echo esc_html( $label ) ?></option> -
affiliate-links/trunk/pro/js/admin-af-links-pro.js
r3150755 r3238736 29 29 var data = { 30 30 'action': aLinkTargetUrl.action, 31 'name': $(this).find('option:selected').val() 31 'name': $(this).find('option:selected').val(), 32 'security': aLinkTargetUrl.security, 32 33 }; 33 34 $.post(aLinkTargetUrl.ajax_url, data, function (response) { -
affiliate-links/trunk/pro/views/html-additional-settings.php
r3150755 r3238736 144 144 var data = { 145 145 'action': aLinkTargetUrl.action, 146 'name': $(this).find('option:selected').val() 146 'name': $(this).find('option:selected').val(), 147 'security': aLinkTargetUrl.security, 147 148 }; 148 149 $.post(aLinkTargetUrl.ajax_url, data, function (response) {
Note: See TracChangeset
for help on using the changeset viewer.