Changeset 3425851
- Timestamp:
- 12/23/2025 06:28:16 AM (2 months ago)
- Location:
- ads-txt-by-magicbid
- Files:
-
- 5 edited
- 4 copied
-
tags/2.1.9 (copied) (copied from ads-txt-by-magicbid/trunk)
-
tags/2.1.9/ads-txt.php (copied) (copied from ads-txt-by-magicbid/trunk/ads-txt.php) (3 diffs)
-
tags/2.1.9/functions/functions.php (copied) (copied from ads-txt-by-magicbid/trunk/functions/functions.php) (7 diffs)
-
tags/2.1.9/readme.txt (copied) (copied from ads-txt-by-magicbid/trunk/readme.txt) (3 diffs)
-
tags/2.1.9/views/admin-page.php (modified) (1 diff)
-
trunk/ads-txt.php (modified) (3 diffs)
-
trunk/functions/functions.php (modified) (7 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/views/admin-page.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ads-txt-by-magicbid/tags/2.1.9/ads-txt.php
r3417323 r3425851 1 1 <?php 2 2 /** 3 * Plugin Name: Ads.txt File Manager 4 * Plugin URI: https://magicbid.ai/contact-us/?utm_source=wordpress-plugin %09&utm_medium=wordpress-plugin%09&utm_campaign=wordpress-plugin-traffic&utm_id=wordpress-plugin%093 * Plugin Name: Ads.txt File Manager By Magicbid 4 * Plugin URI: https://magicbid.ai/contact-us/?utm_source=wordpress-plugin&utm_medium=wordpress-plugin&utm_campaign=wordpress-plugin-traffic&utm_id=wordpress-plugin 5 5 * Description: Easily manage your site's both ads.txt and app-ads.txt file directly from the WordPress admin, with automatic versioned backups. 6 * Version: 2.1. 86 * Version: 2.1.9 7 7 * Author: Magicbid.ai 8 * Author URI: https://magicbid.ai/?utm_source=wordpressplugin %09&utm_medium=wordpressplugin%09&utm_campaign=wordpressplugin%09traffic&utm_id=wordpressplugin%098 * Author URI: https://magicbid.ai/?utm_source=wordpressplugin&utm_medium=wordpressplugin&utm_campaign=wordpressplugintraffic&utm_id=wordpressplugin 9 9 * License: GPL-2.0-or-later 10 10 * License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 54 54 } 55 55 56 define('MB_PLGN_ADS_TXT_TABLE_BACKUPS', $wpdb->prefix . 'mb_plgn_ads_txt_backups' ); 57 56 58 // UPDATE COLUMN 57 59 add_action('plugins_loaded', 'mb_plgn_ads_txt_check_db_version'); … … 62 64 $installed_ver = get_option('mb_plgn_ads_txt_db_version'); 63 65 if ($installed_ver !== MB_PLGN_ADS_TXT_DB_VERSION) { 64 $table_name = $wpdb->prefix . 'mb_plgn_ads_txt_backups';65 66 66 67 // Check if 'file_type' column exists 67 $column = $wpdb->get_results("SHOW COLUMNS FROM `$table_name` LIKE 'file_type'"); 68 if (empty($column)) { 69 $wpdb->query("ALTER TABLE `$table_name` ADD COLUMN `file_type` VARCHAR(10) DEFAULT 'web'"); 68 // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.PreparedSQL.NotPrepared -- $table is derived from $wpdb->prefix and escaped. DDL queries cannot be prepared or cached.; 69 $column = $wpdb->get_var("SHOW COLUMNS FROM `".MB_PLGN_ADS_TXT_TABLE_BACKUPS."` LIKE 'file_type'"); 70 if (empty($column) || $column === null) { 71 // Add column if missing (schema change during plugin upgrade) 72 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.DirectDatabaseQuery.SchemaChange,WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.PreparedSQL.NotPrepared -- $table is derived from $wpdb->prefix and escaped; 73 $wpdb->query("ALTER TABLE `".MB_PLGN_ADS_TXT_TABLE_BACKUPS."` ADD COLUMN `file_type` VARCHAR(10) DEFAULT 'web'"); 70 74 } 71 75 -
ads-txt-by-magicbid/tags/2.1.9/functions/functions.php
r3401696 r3425851 39 39 check_ajax_referer('mb_plgn_ads_txt_nonce'); 40 40 41 $type = $_POST['file_type'] === 'app'? 'app-ads.txt' : 'ads.txt';41 $type = (isset($_POST['file_type']) && $_POST['file_type'] === 'app') ? 'app-ads.txt' : 'ads.txt'; 42 42 $file = MB_PLGN_HOME_PATH . $type; 43 43 if (!file_exists($file)) { … … 50 50 51 51 add_action('wp_ajax_create_mb_plgn_ads_txt', function () { 52 $type = $_POST['file_type'] === 'app'? 'app-ads.txt' : 'ads.txt';52 $type = (isset($_POST['file_type']) && $_POST['file_type'] === 'app') ? 'app-ads.txt' : 'ads.txt'; 53 53 check_ajax_referer('mb_plgn_ads_txt_nonce'); 54 54 file_put_contents(MB_PLGN_HOME_PATH . $type, ''); … … 64 64 } 65 65 $content = implode("\n", array_map('sanitize_text_field', wp_unslash($_POST['content']))); 66 $type = $_POST['file_type'] === 'app'? 'app-ads.txt' : 'ads.txt';66 $type = (isset($_POST['file_type']) && $_POST['file_type'] === 'app') ? 'app-ads.txt' : 'ads.txt'; 67 67 $file = MB_PLGN_HOME_PATH . $type; 68 68 … … 78 78 'content' => $old_content, 79 79 'user_id' => get_current_user_id(), 80 'file_type' => $_POST['file_type'] === 'app'? 'app' : 'web'80 'file_type' => (isset($_POST['file_type']) && $_POST['file_type'] === 'app') ? 'app' : 'web' 81 81 ]); 82 82 } … … 88 88 89 89 add_action('wp_ajax_load_mb_plgn_ads_txt_backups', function () { 90 check_ajax_referer('mb_plgn_ads_txt_nonce'); 91 if (!current_user_can('manage_options')) wp_send_json_error(); 90 92 global $wpdb; 91 $fileType = $_POST['file_type'] === 'app'? 'app' : 'web';93 $fileType = (isset($_POST['file_type']) && $_POST['file_type'] === 'app') ? 'app' : 'web'; 92 94 /** @noinspection SqlResolve */ 93 95 /** @noinspection SqlNoDataSourceInspection */ … … 121 123 122 124 // Backup current before restoring 123 $type = $_POST['file_type'] === 'app'? 'app-ads.txt' : 'ads.txt';125 $type = (isset($_POST['file_type']) && $_POST['file_type'] === 'app') ? 'app-ads.txt' : 'ads.txt'; 124 126 $current = file_get_contents(MB_PLGN_HOME_PATH . $type); 125 127 /** @noinspection SqlResolve */ … … 140 142 141 143 global $wpdb; 142 $id = i ntval($_POST['id']);144 $id = isset($_POST['id']) ? intval($_POST['id']) : ''; 143 145 $table = $wpdb->prefix . 'mb_plgn_ads_txt_backups'; 146 // Delete backup row (safe prepared DELETE query) 147 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching 144 148 $deleted = $wpdb->delete($table, ['id' => $id]); 145 149 -
ads-txt-by-magicbid/tags/2.1.9/readme.txt
r3417323 r3425851 1 === Ads.txt File Manager ===1 === Ads.txt File Manager By Magicbid === 2 2 Contributors: ratneshmagicbid 3 3 Tags: ads.txt, app-ads.txt, monetization, publisher, google ads … … 5 5 Tested up to: 6.9 6 6 Requires PHP: 7.2 7 Stable tag: 2.1. 87 Stable tag: 2.1.9 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 13 13 == Description == 14 14 15 **Ads.txt File Manager ** allows publishers to manage both `ads.txt` and `app-ads.txt` file directly from the WordPress admin panel, without using FTP or file managers. It offers a safe and intuitive UI to help users edit, save, and back up their ads.txt file to comply with programmatic advertising requirements.15 **Ads.txt File Manager By Magicbid** allows publishers to manage both `ads.txt` and `app-ads.txt` file directly from the WordPress admin panel, without using FTP or file managers. It offers a safe and intuitive UI to help users edit, save, and back up their ads.txt file to comply with programmatic advertising requirements. 16 16 17 17 ### Features -
ads-txt-by-magicbid/tags/2.1.9/views/admin-page.php
r3318170 r3425851 1 <?php 2 /* 3 * Admin Page 4 */ 5 if (!defined('ABSPATH')) exit; 6 ?> 7 1 8 <div class="ads-txt-mb-theme"> 2 9 <div class="ads-txt-mb-top-bar"> -
ads-txt-by-magicbid/trunk/ads-txt.php
r3417323 r3425851 1 1 <?php 2 2 /** 3 * Plugin Name: Ads.txt File Manager 4 * Plugin URI: https://magicbid.ai/contact-us/?utm_source=wordpress-plugin %09&utm_medium=wordpress-plugin%09&utm_campaign=wordpress-plugin-traffic&utm_id=wordpress-plugin%093 * Plugin Name: Ads.txt File Manager By Magicbid 4 * Plugin URI: https://magicbid.ai/contact-us/?utm_source=wordpress-plugin&utm_medium=wordpress-plugin&utm_campaign=wordpress-plugin-traffic&utm_id=wordpress-plugin 5 5 * Description: Easily manage your site's both ads.txt and app-ads.txt file directly from the WordPress admin, with automatic versioned backups. 6 * Version: 2.1. 86 * Version: 2.1.9 7 7 * Author: Magicbid.ai 8 * Author URI: https://magicbid.ai/?utm_source=wordpressplugin %09&utm_medium=wordpressplugin%09&utm_campaign=wordpressplugin%09traffic&utm_id=wordpressplugin%098 * Author URI: https://magicbid.ai/?utm_source=wordpressplugin&utm_medium=wordpressplugin&utm_campaign=wordpressplugintraffic&utm_id=wordpressplugin 9 9 * License: GPL-2.0-or-later 10 10 * License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 54 54 } 55 55 56 define('MB_PLGN_ADS_TXT_TABLE_BACKUPS', $wpdb->prefix . 'mb_plgn_ads_txt_backups' ); 57 56 58 // UPDATE COLUMN 57 59 add_action('plugins_loaded', 'mb_plgn_ads_txt_check_db_version'); … … 62 64 $installed_ver = get_option('mb_plgn_ads_txt_db_version'); 63 65 if ($installed_ver !== MB_PLGN_ADS_TXT_DB_VERSION) { 64 $table_name = $wpdb->prefix . 'mb_plgn_ads_txt_backups';65 66 66 67 // Check if 'file_type' column exists 67 $column = $wpdb->get_results("SHOW COLUMNS FROM `$table_name` LIKE 'file_type'"); 68 if (empty($column)) { 69 $wpdb->query("ALTER TABLE `$table_name` ADD COLUMN `file_type` VARCHAR(10) DEFAULT 'web'"); 68 // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.PreparedSQL.NotPrepared -- $table is derived from $wpdb->prefix and escaped. DDL queries cannot be prepared or cached.; 69 $column = $wpdb->get_var("SHOW COLUMNS FROM `".MB_PLGN_ADS_TXT_TABLE_BACKUPS."` LIKE 'file_type'"); 70 if (empty($column) || $column === null) { 71 // Add column if missing (schema change during plugin upgrade) 72 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.DirectDatabaseQuery.SchemaChange,WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.PreparedSQL.NotPrepared -- $table is derived from $wpdb->prefix and escaped; 73 $wpdb->query("ALTER TABLE `".MB_PLGN_ADS_TXT_TABLE_BACKUPS."` ADD COLUMN `file_type` VARCHAR(10) DEFAULT 'web'"); 70 74 } 71 75 -
ads-txt-by-magicbid/trunk/functions/functions.php
r3401696 r3425851 39 39 check_ajax_referer('mb_plgn_ads_txt_nonce'); 40 40 41 $type = $_POST['file_type'] === 'app'? 'app-ads.txt' : 'ads.txt';41 $type = (isset($_POST['file_type']) && $_POST['file_type'] === 'app') ? 'app-ads.txt' : 'ads.txt'; 42 42 $file = MB_PLGN_HOME_PATH . $type; 43 43 if (!file_exists($file)) { … … 50 50 51 51 add_action('wp_ajax_create_mb_plgn_ads_txt', function () { 52 $type = $_POST['file_type'] === 'app'? 'app-ads.txt' : 'ads.txt';52 $type = (isset($_POST['file_type']) && $_POST['file_type'] === 'app') ? 'app-ads.txt' : 'ads.txt'; 53 53 check_ajax_referer('mb_plgn_ads_txt_nonce'); 54 54 file_put_contents(MB_PLGN_HOME_PATH . $type, ''); … … 64 64 } 65 65 $content = implode("\n", array_map('sanitize_text_field', wp_unslash($_POST['content']))); 66 $type = $_POST['file_type'] === 'app'? 'app-ads.txt' : 'ads.txt';66 $type = (isset($_POST['file_type']) && $_POST['file_type'] === 'app') ? 'app-ads.txt' : 'ads.txt'; 67 67 $file = MB_PLGN_HOME_PATH . $type; 68 68 … … 78 78 'content' => $old_content, 79 79 'user_id' => get_current_user_id(), 80 'file_type' => $_POST['file_type'] === 'app'? 'app' : 'web'80 'file_type' => (isset($_POST['file_type']) && $_POST['file_type'] === 'app') ? 'app' : 'web' 81 81 ]); 82 82 } … … 88 88 89 89 add_action('wp_ajax_load_mb_plgn_ads_txt_backups', function () { 90 check_ajax_referer('mb_plgn_ads_txt_nonce'); 91 if (!current_user_can('manage_options')) wp_send_json_error(); 90 92 global $wpdb; 91 $fileType = $_POST['file_type'] === 'app'? 'app' : 'web';93 $fileType = (isset($_POST['file_type']) && $_POST['file_type'] === 'app') ? 'app' : 'web'; 92 94 /** @noinspection SqlResolve */ 93 95 /** @noinspection SqlNoDataSourceInspection */ … … 121 123 122 124 // Backup current before restoring 123 $type = $_POST['file_type'] === 'app'? 'app-ads.txt' : 'ads.txt';125 $type = (isset($_POST['file_type']) && $_POST['file_type'] === 'app') ? 'app-ads.txt' : 'ads.txt'; 124 126 $current = file_get_contents(MB_PLGN_HOME_PATH . $type); 125 127 /** @noinspection SqlResolve */ … … 140 142 141 143 global $wpdb; 142 $id = i ntval($_POST['id']);144 $id = isset($_POST['id']) ? intval($_POST['id']) : ''; 143 145 $table = $wpdb->prefix . 'mb_plgn_ads_txt_backups'; 146 // Delete backup row (safe prepared DELETE query) 147 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching 144 148 $deleted = $wpdb->delete($table, ['id' => $id]); 145 149 -
ads-txt-by-magicbid/trunk/readme.txt
r3417323 r3425851 1 === Ads.txt File Manager ===1 === Ads.txt File Manager By Magicbid === 2 2 Contributors: ratneshmagicbid 3 3 Tags: ads.txt, app-ads.txt, monetization, publisher, google ads … … 5 5 Tested up to: 6.9 6 6 Requires PHP: 7.2 7 Stable tag: 2.1. 87 Stable tag: 2.1.9 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 13 13 == Description == 14 14 15 **Ads.txt File Manager ** allows publishers to manage both `ads.txt` and `app-ads.txt` file directly from the WordPress admin panel, without using FTP or file managers. It offers a safe and intuitive UI to help users edit, save, and back up their ads.txt file to comply with programmatic advertising requirements.15 **Ads.txt File Manager By Magicbid** allows publishers to manage both `ads.txt` and `app-ads.txt` file directly from the WordPress admin panel, without using FTP or file managers. It offers a safe and intuitive UI to help users edit, save, and back up their ads.txt file to comply with programmatic advertising requirements. 16 16 17 17 ### Features -
ads-txt-by-magicbid/trunk/views/admin-page.php
r3318170 r3425851 1 <?php 2 /* 3 * Admin Page 4 */ 5 if (!defined('ABSPATH')) exit; 6 ?> 7 1 8 <div class="ads-txt-mb-theme"> 2 9 <div class="ads-txt-mb-top-bar">
Note: See TracChangeset
for help on using the changeset viewer.