Changeset 3487830
- Timestamp:
- 03/21/2026 03:45:13 PM (8 days ago)
- Location:
- ad-commander
- Files:
-
- 8 edited
- 1 copied
-
tags/1.1.27 (copied) (copied from ad-commander/trunk)
-
tags/1.1.27/ad-commander.php (modified) (2 diffs)
-
tags/1.1.27/includes/AdCommander.php (modified) (1 diff)
-
tags/1.1.27/includes/Admin.php (modified) (68 diffs)
-
tags/1.1.27/readme.txt (modified) (2 diffs)
-
trunk/ad-commander.php (modified) (2 diffs)
-
trunk/includes/AdCommander.php (modified) (1 diff)
-
trunk/includes/Admin.php (modified) (68 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ad-commander/tags/1.1.27/ad-commander.php
r3487808 r3487830 4 4 * Plugin URI: https://wpadcommander.com 5 5 * Description: Insert, schedule and track custom advertising banners or script ads from AdSense, Amazon, and other affiliate networks into your site. 6 * Version: 1.1.2 66 * Version: 1.1.27 7 7 * Author: Wild Operation 8 8 * Author URI: https://wildoperation.com … … 14 14 * @subpackage Ad Commander - Banner & Ad Manager 15 15 * @since 1.0.0 16 * @version 1.1.2 616 * @version 1.1.27 17 17 */ 18 18 -
ad-commander/tags/1.1.27/includes/AdCommander.php
r3487808 r3487830 13 13 */ 14 14 public static function version() { 15 return '1.1.2 6';15 return '1.1.27'; 16 16 } 17 17 -
ad-commander/tags/1.1.27/includes/Admin.php
r3487808 r3487830 1242 1242 <img src="<?php echo esc_url( AdCommander::assets_url() . 'img/logo.svg' ); ?>" alt="<?php echo esc_attr( AdCommander::title() ); ?>" class="adcmdr-logo" /> 1243 1243 <div class="adcmdr-btn-group"> 1244 <?php if ( ! ProBridge::instance()->is_pro_loaded() ) : ?>1244 <?php if ( ! ProBridge::instance()->is_pro_loaded() ) : ?> 1245 1245 <a href="<?php echo esc_url( AdCommander::public_site_url( '', array( 'utm_medium' => 'button' ) ) ); ?>" class="button button-adcmdr-primary" target="_blank"><?php esc_html_e( 'Get Pro', 'ad-commander' ); ?></a> 1246 1246 <?php endif; ?> … … 1250 1250 </div> 1251 1251 <?php 1252 endif;1252 endif; 1253 1253 } 1254 1254 … … 1347 1347 </div> 1348 1348 <div class="inside"> 1349 <?php echo wp_kses_post( $content ); ?>1349 <?php echo wp_kses_post( $content ); ?> 1350 1350 </div> 1351 1351 </div> … … 1403 1403 ?> 1404 1404 <h2><?php _e( 'System Information for Debugging', 'ad-commander' ); ?></h2> 1405 <p><?php _e( 'If you are experiencing issues with the plugin, please copy and paste the following information in your support request. This will help us to debug the issue.', 'ad-commander' ); ?></p> 1406 <p><?php _e( 'IMPORTANT: May contain your geolocation information if geotargeting is enabled.', 'ad-commander' ); ?></p> 1405 1407 <?php 1406 1408 $settings = self::settings(); … … 1438 1440 1439 1441 if ( ! empty( $group['sections'] ) ) { 1440 foreach ( $group['sections'] as $section ) {1442 foreach ( $group['sections'] as $section_key => $section ) { 1441 1443 if ( empty( $section['fields'] ) ) { 1442 1444 continue; … … 1451 1453 1452 1454 $value = isset( $raw_group[ $field_key ] ) ? $raw_group[ $field_key ] : null; 1453 $lines[] = $this->format_debug_line( $label, $this->format_debug_value( $value ) ); 1455 $lines[] = $this->format_debug_line( $label, $this->format_debug_value( $value, ( in_array( $field_key, array( 'maxmind_license_key', 'pro_license_key' ) ) ) ) ); 1456 } 1457 1458 if ( $section_key === 'geotargeting' && ProBridge::instance()->is_pro_loaded() ) { 1459 $visitor = GeoPro::instance()->get_visitor( true ); 1460 if ( $visitor && ! empty( $visitor ) ) { 1461 $lines[] = ''; 1462 $lines[] = '### ' . __( 'Current Visitor Geo', 'ad-commander' ); 1463 1464 $visitor_labels = array( 1465 'lookup_types' => __( 'Lookup Types', 'ad-commander' ), 1466 'city' => __( 'City', 'ad-commander' ), 1467 'region' => __( 'Region', 'ad-commander' ), 1468 'country_code' => __( 'Country Code', 'ad-commander' ), 1469 'continent_code' => __( 'Continent Code', 'ad-commander' ), 1470 'lat' => __( 'Latitude', 'ad-commander' ), 1471 'lng' => __( 'Longitude', 'ad-commander' ), 1472 ); 1473 1474 foreach ( $visitor_labels as $key => $label ) { 1475 if ( isset( $visitor[ $key ] ) ) { 1476 $value = is_array( $visitor[ $key ] ) ? implode( ', ', $visitor[ $key ] ) : $visitor[ $key ]; 1477 $lines[] = $this->format_debug_line( $label, $value ); 1478 } 1479 } 1480 } 1454 1481 } 1455 1482 } … … 1457 1484 } 1458 1485 1459 /**1460 * WordPress Environment1461 */1462 global $wpdb;1463 1464 $lines[] = '';1465 $lines[] = '## ' . __( 'WordPress Environment', 'ad-commander' );1466 $lines[] = '';1467 $lines[] = $this->format_debug_line( __( 'Home URL', 'ad-commander' ), home_url() );1468 $lines[] = $this->format_debug_line( __( 'Site URL', 'ad-commander' ), site_url() );1469 $lines[] = $this->format_debug_line( __( 'REST API Base URL', 'ad-commander' ), rest_url() );1470 $lines[] = $this->format_debug_line( __( 'WordPress Version', 'ad-commander' ), get_bloginfo( 'version' ) );1471 $lines[] = $this->format_debug_line( __( 'WordPress Multisite', 'ad-commander' ), is_multisite() ? __( 'Yes', 'ad-commander' ) : __( 'No', 'ad-commander' ) );1472 $lines[] = $this->format_debug_line( __( 'WordPress Memory Limit', 'ad-commander' ), WP_MEMORY_LIMIT );1473 $lines[] = $this->format_debug_line( __( 'WordPress Debug Mode', 'ad-commander' ), ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ? __( 'Yes', 'ad-commander' ) : __( 'No', 'ad-commander' ) );1474 $lines[] = $this->format_debug_line( __( 'WordPress Debug Log', 'ad-commander' ), ( defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG ) ? __( 'Yes', 'ad-commander' ) : __( 'No', 'ad-commander' ) );1475 $lines[] = $this->format_debug_line( __( 'WordPress Cron', 'ad-commander' ), ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) ? __( 'No', 'ad-commander' ) : __( 'Yes', 'ad-commander' ) );1476 $lines[] = $this->format_debug_line( __( 'WordPress Locale', 'ad-commander' ), get_locale() );1477 1478 /**1479 * Active Theme1480 */1481 $theme = wp_get_theme();1482 $theme_author = $theme->get( 'Author' );1483 $theme_detail = $theme_author ? 'by ' . wp_strip_all_tags( $theme_author ) . ' — ' . $theme->get( 'Version' ) : $theme->get( 'Version' );1484 1485 $lines[] = '';1486 $lines[] = '## ' . __( 'Active Theme', 'ad-commander' );1487 $lines[] = '';1488 $lines[] = $this->format_debug_line( $theme->get( 'Name' ), $theme_detail );1486 /** 1487 * WordPress Environment 1488 */ 1489 global $wpdb; 1490 1491 $lines[] = ''; 1492 $lines[] = '## ' . __( 'WordPress Environment', 'ad-commander' ); 1493 $lines[] = ''; 1494 $lines[] = $this->format_debug_line( __( 'Home URL', 'ad-commander' ), home_url() ); 1495 $lines[] = $this->format_debug_line( __( 'Site URL', 'ad-commander' ), site_url() ); 1496 $lines[] = $this->format_debug_line( __( 'REST API Base URL', 'ad-commander' ), rest_url() ); 1497 $lines[] = $this->format_debug_line( __( 'WordPress Version', 'ad-commander' ), get_bloginfo( 'version' ) ); 1498 $lines[] = $this->format_debug_line( __( 'WordPress Multisite', 'ad-commander' ), is_multisite() ? __( 'Yes', 'ad-commander' ) : __( 'No', 'ad-commander' ) ); 1499 $lines[] = $this->format_debug_line( __( 'WordPress Memory Limit', 'ad-commander' ), WP_MEMORY_LIMIT ); 1500 $lines[] = $this->format_debug_line( __( 'WordPress Debug Mode', 'ad-commander' ), ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ? __( 'Yes', 'ad-commander' ) : __( 'No', 'ad-commander' ) ); 1501 $lines[] = $this->format_debug_line( __( 'WordPress Debug Log', 'ad-commander' ), ( defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG ) ? __( 'Yes', 'ad-commander' ) : __( 'No', 'ad-commander' ) ); 1502 $lines[] = $this->format_debug_line( __( 'WordPress Cron', 'ad-commander' ), ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) ? __( 'No', 'ad-commander' ) : __( 'Yes', 'ad-commander' ) ); 1503 $lines[] = $this->format_debug_line( __( 'WordPress Locale', 'ad-commander' ), get_locale() ); 1504 1505 /** 1506 * Active Theme 1507 */ 1508 $theme = wp_get_theme(); 1509 $theme_author = $theme->get( 'Author' ); 1510 $theme_detail = $theme_author ? 'by ' . wp_strip_all_tags( $theme_author ) . ' — ' . $theme->get( 'Version' ) : $theme->get( 'Version' ); 1511 1512 $lines[] = ''; 1513 $lines[] = '## ' . __( 'Active Theme', 'ad-commander' ); 1514 $lines[] = ''; 1515 $lines[] = $this->format_debug_line( $theme->get( 'Name' ), $theme_detail ); 1489 1516 1490 1517 if ( $theme->parent() ) { … … 1492 1519 } 1493 1520 1494 /**1495 * Active Plugins1496 */1497 $active_plugins = get_option( 'active_plugins', array() );1498 $all_plugins = get_plugins();1499 1500 $lines[] = '';1501 $lines[] = '## ' . __( 'Active Plugins', 'ad-commander' );1502 $lines[] = '';1521 /** 1522 * Active Plugins 1523 */ 1524 $active_plugins = get_option( 'active_plugins', array() ); 1525 $all_plugins = get_plugins(); 1526 1527 $lines[] = ''; 1528 $lines[] = '## ' . __( 'Active Plugins', 'ad-commander' ); 1529 $lines[] = ''; 1503 1530 1504 1531 foreach ( $active_plugins as $plugin_path ) { … … 1511 1538 } 1512 1539 1513 /**1514 * Server Environment1515 */1516 $lines[] = '';1517 $lines[] = '## ' . __( 'Server Environment', 'ad-commander' );1518 $lines[] = '';1519 $lines[] = $this->format_debug_line( __( 'Web Server', 'ad-commander' ), isset( $_SERVER['SERVER_SOFTWARE'] ) ? sanitize_text_field( wp_unslash( $_SERVER['SERVER_SOFTWARE'] ) ) : __( 'Unknown', 'ad-commander' ) );1520 $lines[] = $this->format_debug_line( __( 'PHP Version', 'ad-commander' ), function_exists( 'phpversion' ) ? phpversion() : __( 'Unknown', 'ad-commander' ) );1521 $lines[] = $this->format_debug_line( __( 'PHP Memory Limit', 'ad-commander' ), function_exists( 'ini_get' ) ? ini_get( 'memory_limit' ) : __( 'Unknown', 'ad-commander' ) );1522 $lines[] = $this->format_debug_line( __( 'PHP Max Execution Time', 'ad-commander' ), function_exists( 'ini_get' ) ? ini_get( 'max_execution_time' ) : __( 'Unknown', 'ad-commander' ) );1523 $lines[] = $this->format_debug_line( __( 'PHP Max Upload Size', 'ad-commander' ), function_exists( 'ini_get' ) ? ini_get( 'upload_max_filesize' ) : __( 'Unknown', 'ad-commander' ) );1524 $lines[] = $this->format_debug_line( __( 'PHP Max Post Size', 'ad-commander' ), function_exists( 'ini_get' ) ? ini_get( 'post_max_size' ) : __( 'Unknown', 'ad-commander' ) );1525 $lines[] = $this->format_debug_line( __( 'cURL Enabled', 'ad-commander' ), function_exists( 'curl_version' ) ? __( 'Yes', 'ad-commander' ) . ' (' . curl_version()['version'] . ')' : __( 'No', 'ad-commander' ) );1526 $lines[] = $this->format_debug_line( __( 'OpenSSL', 'ad-commander' ), defined( 'OPENSSL_VERSION_TEXT' ) ? OPENSSL_VERSION_TEXT : __( 'No', 'ad-commander' ) );1527 1528 /**1529 * Database1530 */1531 $lines[] = '';1532 $lines[] = '## ' . __( 'Database', 'ad-commander' );1533 $lines[] = '';1534 $lines[] = $this->format_debug_line( __( 'Database System', 'ad-commander' ), ! empty( $wpdb->db_server_info() ) ? $wpdb->db_server_info() : __( 'Unknown', 'ad-commander' ) );1535 $lines[] = $this->format_debug_line( __( 'Database Version', 'ad-commander' ), $wpdb->db_version() );1536 $lines[] = $this->format_debug_line( __( 'Database Character Set', 'ad-commander' ), ! empty( $wpdb->charset ) ? $wpdb->charset : __( 'Unknown', 'ad-commander' ) );1537 $lines[] = $this->format_debug_line( __( 'Database Collation', 'ad-commander' ), ! empty( $wpdb->collate ) ? $wpdb->collate : __( 'Unknown', 'ad-commander' ) );1538 $lines[] = $this->format_debug_line( __( 'Database Prefix', 'ad-commander' ), $wpdb->prefix );1539 1540 /**1541 * Date and Time1542 */1543 $lines[] = '';1544 $lines[] = '## ' . __( 'Date and Time', 'ad-commander' );1545 $lines[] = '';1546 $lines[] = $this->format_debug_line( __( 'WordPress Timezone', 'ad-commander' ), wp_timezone_string() );1547 $lines[] = $this->format_debug_line( __( 'Server Time (UTC)', 'ad-commander' ), gmdate( 'Y-m-d H:i:s' ) );1548 $lines[] = $this->format_debug_line( __( 'Local Time', 'ad-commander' ), wp_date( 'Y-m-d H:i:s' ) );1549 1550 $output = implode( "\n", $lines );1540 /** 1541 * Server Environment 1542 */ 1543 $lines[] = ''; 1544 $lines[] = '## ' . __( 'Server Environment', 'ad-commander' ); 1545 $lines[] = ''; 1546 $lines[] = $this->format_debug_line( __( 'Web Server', 'ad-commander' ), isset( $_SERVER['SERVER_SOFTWARE'] ) ? sanitize_text_field( wp_unslash( $_SERVER['SERVER_SOFTWARE'] ) ) : __( 'Unknown', 'ad-commander' ) ); 1547 $lines[] = $this->format_debug_line( __( 'PHP Version', 'ad-commander' ), function_exists( 'phpversion' ) ? phpversion() : __( 'Unknown', 'ad-commander' ) ); 1548 $lines[] = $this->format_debug_line( __( 'PHP Memory Limit', 'ad-commander' ), function_exists( 'ini_get' ) ? ini_get( 'memory_limit' ) : __( 'Unknown', 'ad-commander' ) ); 1549 $lines[] = $this->format_debug_line( __( 'PHP Max Execution Time', 'ad-commander' ), function_exists( 'ini_get' ) ? ini_get( 'max_execution_time' ) : __( 'Unknown', 'ad-commander' ) ); 1550 $lines[] = $this->format_debug_line( __( 'PHP Max Upload Size', 'ad-commander' ), function_exists( 'ini_get' ) ? ini_get( 'upload_max_filesize' ) : __( 'Unknown', 'ad-commander' ) ); 1551 $lines[] = $this->format_debug_line( __( 'PHP Max Post Size', 'ad-commander' ), function_exists( 'ini_get' ) ? ini_get( 'post_max_size' ) : __( 'Unknown', 'ad-commander' ) ); 1552 $lines[] = $this->format_debug_line( __( 'cURL Enabled', 'ad-commander' ), function_exists( 'curl_version' ) ? __( 'Yes', 'ad-commander' ) . ' (' . curl_version()['version'] . ')' : __( 'No', 'ad-commander' ) ); 1553 $lines[] = $this->format_debug_line( __( 'OpenSSL', 'ad-commander' ), defined( 'OPENSSL_VERSION_TEXT' ) ? OPENSSL_VERSION_TEXT : __( 'No', 'ad-commander' ) ); 1554 1555 /** 1556 * Database 1557 */ 1558 $lines[] = ''; 1559 $lines[] = '## ' . __( 'Database', 'ad-commander' ); 1560 $lines[] = ''; 1561 $lines[] = $this->format_debug_line( __( 'Database System', 'ad-commander' ), ! empty( $wpdb->db_server_info() ) ? $wpdb->db_server_info() : __( 'Unknown', 'ad-commander' ) ); 1562 $lines[] = $this->format_debug_line( __( 'Database Version', 'ad-commander' ), $wpdb->db_version() ); 1563 $lines[] = $this->format_debug_line( __( 'Database Character Set', 'ad-commander' ), ! empty( $wpdb->charset ) ? $wpdb->charset : __( 'Unknown', 'ad-commander' ) ); 1564 $lines[] = $this->format_debug_line( __( 'Database Collation', 'ad-commander' ), ! empty( $wpdb->collate ) ? $wpdb->collate : __( 'Unknown', 'ad-commander' ) ); 1565 $lines[] = $this->format_debug_line( __( 'Database Prefix', 'ad-commander' ), $wpdb->prefix ); 1566 1567 /** 1568 * Date and Time 1569 */ 1570 $lines[] = ''; 1571 $lines[] = '## ' . __( 'Date and Time', 'ad-commander' ); 1572 $lines[] = ''; 1573 $lines[] = $this->format_debug_line( __( 'WordPress Timezone', 'ad-commander' ), wp_timezone_string() ); 1574 $lines[] = $this->format_debug_line( __( 'Server Time (UTC)', 'ad-commander' ), gmdate( 'Y-m-d H:i:s' ) ); 1575 $lines[] = $this->format_debug_line( __( 'Local Time', 'ad-commander' ), wp_date( 'Y-m-d H:i:s' ) ); 1576 1577 $output = implode( "\n", $lines ); 1551 1578 ?> 1552 1579 <div class="adcmdr-debug"> … … 1554 1581 <textarea readonly="readonly" onclick="this.select();"><?php echo esc_textarea( $output ); ?></textarea> 1555 1582 </div> 1556 <?php1557 } 1558 1559 /**1560 * Format a single line for the debug textarea.1561 *1562 * @param string $label The label.1563 * @param string $value The value.1564 *1565 * @return string1566 */1583 <?php 1584 } 1585 1586 /** 1587 * Format a single line for the debug textarea. 1588 * 1589 * @param string $label The label. 1590 * @param string $value The value. 1591 * 1592 * @return string 1593 */ 1567 1594 private function format_debug_line( $label, $value ) { 1568 return $label . ': ' . $value;1569 } 1570 1571 /**1572 * Format a value for debug display.1573 *1574 * @param mixed $value The value to format.1575 *1576 * @return string1577 */1578 private function format_debug_value( $value ) {1595 return esc_html( $label ) . ': ' . esc_html( $value ); 1596 } 1597 1598 /** 1599 * Format a value for debug display. 1600 * 1601 * @param mixed $value The value to format. 1602 * 1603 * @return string 1604 */ 1605 private function format_debug_value( $value, $exists_only = false ) { 1579 1606 if ( is_null( $value ) || ( is_string( $value ) && '' === $value ) ) { 1580 1607 return '—'; 1581 1608 } 1582 1609 1583 if ( is_bool( $value ) ) {1610 if ( is_bool( $value ) || ( $exists_only && ! empty( $value ) ) ) { 1584 1611 return $value ? __( 'Yes', 'ad-commander' ) : __( 'No', 'ad-commander' ); 1585 1612 } … … 1612 1639 } 1613 1640 1614 /**1615 * Register settings from settings array.1616 *1617 * @return void1618 */1641 /** 1642 * Register settings from settings array. 1643 * 1644 * @return void 1645 */ 1619 1646 public function register_settings() { 1620 1647 $this->sf()->add_sections_and_settings( … … 1624 1651 } 1625 1652 1626 /**1627 * Sanitize input by type.1628 *1629 * @param array $input The input to sanitize.1630 *1631 * @return array1632 */1653 /** 1654 * Sanitize input by type. 1655 * 1656 * @param array $input The input to sanitize. 1657 * 1658 * @return array 1659 */ 1633 1660 private function sanitize_by_key_type( $input ) { 1634 1661 $output = array(); … … 1677 1704 } 1678 1705 1679 /**1680 * Sanitize general group.1681 *1682 * @param array $input The input to sanitize.1683 *1684 * @return array1685 */1706 /** 1707 * Sanitize general group. 1708 * 1709 * @param array $input The input to sanitize. 1710 * 1711 * @return array 1712 */ 1686 1713 public function sanitize_adcmdr_general( $input ) { 1687 1714 Maintenance::flush_css_transients(); … … 1689 1716 } 1690 1717 1691 /**1692 * Sanitize admin group.1693 *1694 * @param array $input The input to sanitize.1695 *1696 * @return array1697 */1718 /** 1719 * Sanitize admin group. 1720 * 1721 * @param array $input The input to sanitize. 1722 * 1723 * @return array 1724 */ 1698 1725 public function sanitize_adcmdr_admin( $input ) { 1699 1726 return $this->sanitize_by_key_type( $input ); 1700 1727 } 1701 1728 1702 /**1703 * Sanitize tracking group.1704 *1705 * @param array $input The input to sanitize.1706 *1707 * @return array1708 */1729 /** 1730 * Sanitize tracking group. 1731 * 1732 * @param array $input The input to sanitize. 1733 * 1734 * @return array 1735 */ 1709 1736 public function sanitize_adcmdr_tracking( $input ) { 1710 1737 return $this->sanitize_by_key_type( $input ); 1711 1738 } 1712 1739 1713 /**1714 * Sanitize adsense group.1715 *1716 * @param array $input The input to sanitize.1717 *1718 * @return array1719 */1740 /** 1741 * Sanitize adsense group. 1742 * 1743 * @param array $input The input to sanitize. 1744 * 1745 * @return array 1746 */ 1720 1747 public function sanitize_adcmdr_adsense( $input ) { 1721 1748 return $this->sanitize_by_key_type( $input ); 1722 1749 } 1723 1750 1724 /**1725 * Sanitize privacy group.1726 *1727 * @param array $input The input to sanitize.1728 *1729 * @return array1730 */1751 /** 1752 * Sanitize privacy group. 1753 * 1754 * @param array $input The input to sanitize. 1755 * 1756 * @return array 1757 */ 1731 1758 public function sanitize_adcmdr_privacy( $input ) { 1732 1759 return $this->sanitize_by_key_type( $input ); 1733 1760 } 1734 1761 1735 /**1736 * Sanitize geotargeting group.1737 *1738 * @param array $input The input to sanitize.1739 *1740 * @return array1741 */1762 /** 1763 * Sanitize geotargeting group. 1764 * 1765 * @param array $input The input to sanitize. 1766 * 1767 * @return array 1768 */ 1742 1769 public function sanitize_adcmdr_targeting( $input ) { 1743 1770 return $this->sanitize_by_key_type( $input ); 1744 1771 } 1745 1772 1746 /**1747 * Sanitize add-on group.1748 *1749 * @param array $input The input to sanitize.1750 *1751 * @return array1752 */1773 /** 1774 * Sanitize add-on group. 1775 * 1776 * @param array $input The input to sanitize. 1777 * 1778 * @return array 1779 */ 1753 1780 public function sanitize_adcmdr_addons( $input ) { 1754 1781 return $this->sanitize_by_key_type( $input ); 1755 1782 } 1756 1783 1757 /**1758 * Create an underscored key from a string.1759 *1760 * @param string $key The key to convert.1761 *1762 * @return string1763 */1784 /** 1785 * Create an underscored key from a string. 1786 * 1787 * @param string $key The key to convert. 1788 * 1789 * @return string 1790 */ 1764 1791 public function _key( $key ) { 1765 1792 return str_replace( '-', '_', $key ); 1766 1793 } 1767 1794 1768 /**1769 * Create a nonce array.1770 * This is not an actual nonce. This array is used for creating and checking unique nonces.1771 *1772 * @param string $action The action..1773 * @param string $key The key to create the nonce string from.1774 *1775 * @return array1776 */1795 /** 1796 * Create a nonce array. 1797 * This is not an actual nonce. This array is used for creating and checking unique nonces. 1798 * 1799 * @param string $action The action.. 1800 * @param string $key The key to create the nonce string from. 1801 * 1802 * @return array 1803 */ 1777 1804 protected function nonce( $action, $key ) { 1778 1805 return array( … … 1782 1809 } 1783 1810 1784 /**1785 * Create a nonce field.1786 *1787 * @param array $nonce_arr A nonce array.1788 * @param bool $referrer Whether to include the referrer field.1789 *1790 * @return void1791 */1811 /** 1812 * Create a nonce field. 1813 * 1814 * @param array $nonce_arr A nonce array. 1815 * @param bool $referrer Whether to include the referrer field. 1816 * 1817 * @return void 1818 */ 1792 1819 protected function nonce_field( $nonce_arr, $referrer = false ) { 1793 1820 wp_nonce_field( $nonce_arr['action'], $nonce_arr['name'], $referrer ); 1794 1821 } 1795 1822 1796 /**1797 * Create a string for use in your nonce.1798 *1799 * @param string $action Action name.1800 *1801 * @return string1802 */1823 /** 1824 * Create a string for use in your nonce. 1825 * 1826 * @param string $action Action name. 1827 * 1828 * @return string 1829 */ 1803 1830 protected function nonce_string( $action ) { 1804 1831 return sanitize_title( Util::ns( 'n-' . $action ) ); 1805 1832 } 1806 1833 1807 /**1808 * Create an action string for use in your nonce.1809 *1810 * @param string $action Action name.1811 *1812 * @return string1813 */1834 /** 1835 * Create an action string for use in your nonce. 1836 * 1837 * @param string $action Action name. 1838 * 1839 * @return string 1840 */ 1814 1841 protected function action_string( $action ) { 1815 1842 return self::_key( sanitize_title( Util::ns( $action, '_' ) ) ); 1816 1843 } 1817 1844 1818 /**1819 * Authorizes actions for non-settings pages.1820 * Interfaces with WOAdmin to check nonce, capability, and required $_POST keys.1821 *1822 * @param mixed $action_key The action key to authorized.1823 * @param array $required_post Any required post keys.1824 * @param string|bool $capability The capability required to process this action.1825 *1826 * @return void1827 */1845 /** 1846 * Authorizes actions for non-settings pages. 1847 * Interfaces with WOAdmin to check nonce, capability, and required $_POST keys. 1848 * 1849 * @param mixed $action_key The action key to authorized. 1850 * @param array $required_post Any required post keys. 1851 * @param string|bool $capability The capability required to process this action. 1852 * 1853 * @return void 1854 */ 1828 1855 protected function check_ajax_action( $action_key, $required_post = array(), $capability = false ) { 1829 1856 /** … … 1840 1867 } 1841 1868 1842 /**1843 * Call back for settings section.1844 *1845 * @return void1846 */1869 /** 1870 * Call back for settings section. 1871 * 1872 * @return void 1873 */ 1847 1874 public function settings_callback_adcmdr_defaults() { 1848 1875 ?> 1849 1876 1850 1877 <p><?php esc_html_e( 'These settings can be overridden by individual ads if needed.', 'ad-commander' ); ?></p> 1851 <?php1852 } 1853 1854 /**1855 * Call back for settings section.1856 *1857 * @return void1858 */1878 <?php 1879 } 1880 1881 /** 1882 * Call back for settings section. 1883 * 1884 * @return void 1885 */ 1859 1886 public function settings_callback_adcmdr_consent() { 1860 1887 if ( Util::render_method() === 'serverside' ) { … … 1864 1891 ?> 1865 1892 <p><?php esc_html_e( 'Ad Commander does not create a consent banner. These settings allow you to integrate with a consent management plugin.', 'ad-commander' ); ?></p> 1866 <?php1867 } 1868 1869 /**1870 * Call back for settings section.1871 *1872 * @return void1873 */1893 <?php 1894 } 1895 1896 /** 1897 * Call back for settings section. 1898 * 1899 * @return void 1900 */ 1874 1901 public function settings_callback_adcmdr_general() {} 1875 1902 1876 /**1877 * Call back for settings section.1878 *1879 * @return void1880 */1903 /** 1904 * Call back for settings section. 1905 * 1906 * @return void 1907 */ 1881 1908 public function settings_callback_adcmdr_tracking_methods() {} 1882 1909 1883 /**1884 * Call back for settings section.1885 *1886 * @return void1887 */1910 /** 1911 * Call back for settings section. 1912 * 1913 * @return void 1914 */ 1888 1915 public function settings_callback_adcmdr_disable_ads() {} 1889 1916 1890 /**1891 * Call back for settings section.1892 *1893 * @return void1894 */1917 /** 1918 * Call back for settings section. 1919 * 1920 * @return void 1921 */ 1895 1922 public function settings_callback_adcmdr_advanced_settings() {} 1896 1923 1897 /**1898 * Call back for settings section.1899 *1900 * @return void1901 */1924 /** 1925 * Call back for settings section. 1926 * 1927 * @return void 1928 */ 1902 1929 public function settings_callback_adcmdr_admin() { 1903 1930 } 1904 1931 1905 /**1906 * Call back for settings section.1907 *1908 * @return void1909 */1932 /** 1933 * Call back for settings section. 1934 * 1935 * @return void 1936 */ 1910 1937 public function settings_callback_adcmdr_notifications() {} 1911 1938 1912 /**1913 * Call back for settings section.1914 *1915 * @return void1916 */1939 /** 1940 * Call back for settings section. 1941 * 1942 * @return void 1943 */ 1917 1944 public function settings_callback_adcmdr_misc() {} 1918 1945 1919 /**1920 * Call back for settings section.1921 *1922 * @return void1923 */1946 /** 1947 * Call back for settings section. 1948 * 1949 * @return void 1950 */ 1924 1951 public function settings_callback_adcmdr_onboarding() {} 1925 1952 1926 /**1927 * Call back for settings section.1928 *1929 * @return void1930 */1953 /** 1954 * Call back for settings section. 1955 * 1956 * @return void 1957 */ 1931 1958 public function settings_callback_adcmdr_geotargeting() {} 1932 1959 1933 /**1934 * Call back for settings section.1935 *1936 * @return void1937 */1960 /** 1961 * Call back for settings section. 1962 * 1963 * @return void 1964 */ 1938 1965 public function settings_callback_adcmdr_multisite() {} 1939 1966 1940 /**1941 * Call back for settings section.1942 *1943 * @return void1944 */1967 /** 1968 * Call back for settings section. 1969 * 1970 * @return void 1971 */ 1945 1972 public function settings_callback_adcmdr_ads_txt() { 1946 1973 ?> 1947 1974 <p><?php esc_html_e( 'Ad Commander will attempt to generate an ads.txt in the root of your website. If an AdSense account is enabled, it will be included, along with any additional records added below.', 'ad-commander' ); ?></p> 1948 <?php1949 } 1950 1951 /**1952 * Call back for settings section.1953 *1954 * @return void1955 */1975 <?php 1976 } 1977 1978 /** 1979 * Call back for settings section. 1980 * 1981 * @return void 1982 */ 1956 1983 public function settings_callback_adcmdr_disable_tracking() { 1957 1984 ?> 1958 1985 <p><?php esc_html_e( 'Fine-tune tracking settings by disabling some features below.', 'ad-commander' ); ?></p> 1959 <?php1960 } 1961 1962 /**1963 * Call back for settings section.1964 *1965 * @return void1966 */1986 <?php 1987 } 1988 1989 /** 1990 * Call back for settings section. 1991 * 1992 * @return void 1993 */ 1967 1994 public function settings_callback_adcmdr_tracking() {} 1968 1995 1969 /**1970 * Call back for settings section.1971 *1972 * @return void1973 */1996 /** 1997 * Call back for settings section. 1998 * 1999 * @return void 2000 */ 1974 2001 public function settings_callback_adcmdr_licenses() {} 1975 2002 1976 /**1977 * Call back for settings section.1978 *1979 * @return void1980 */2003 /** 2004 * Call back for settings section. 2005 * 2006 * @return void 2007 */ 1981 2008 public function settings_callback_adcmdr_support() {} 1982 2009 1983 /**1984 * Call back for settings section.1985 *1986 * @return void1987 */2010 /** 2011 * Call back for settings section. 2012 * 2013 * @return void 2014 */ 1988 2015 public function settings_callback_adcmdr_adsense() {} 1989 2016 1990 /**1991 * Perform actions during add-on options updates.1992 * Specifically, determine if the license key has changed.1993 *1994 * @param mixed $new_value The new value of the option.1995 * @param mixed $old_value The old value of the option.1996 *1997 * @return mixed1998 */2017 /** 2018 * Perform actions during add-on options updates. 2019 * Specifically, determine if the license key has changed. 2020 * 2021 * @param mixed $new_value The new value of the option. 2022 * @param mixed $old_value The old value of the option. 2023 * 2024 * @return mixed 2025 */ 1999 2026 public function addon_options_updated( $new_value, $old_value ) { 2000 2027 … … 2018 2045 } 2019 2046 2020 /**2021 * Callback for settings field.2022 *2023 * @return void2024 */2047 /** 2048 * Callback for settings field. 2049 * 2050 * @return void 2051 */ 2025 2052 public function field_adcmdr_pro_license_key() { 2026 2053 $pro_bridge = ProBridge::instance(); … … 2086 2113 } 2087 2114 2088 /**2089 * Callback for settings field.2090 *2091 * @return void2092 */2115 /** 2116 * Callback for settings field. 2117 * 2118 * @return void 2119 */ 2093 2120 public function field_adcmdr_geo_service() { 2094 2121 $id = array( $this->sf()->key( 'targeting' ) => 'geo_service' ); … … 2125 2152 } 2126 2153 2127 /**2128 * Callback for settings field.2129 *2130 * @return void2131 */2154 /** 2155 * Callback for settings field. 2156 * 2157 * @return void 2158 */ 2132 2159 public function field_adcmdr_maxmind_license_key() { 2133 2160 if ( ProBridge::instance()->is_pro_loaded() ) { … … 2136 2163 } 2137 2164 2138 /**2139 * Callback for settings field.2140 *2141 * @return void2142 */2165 /** 2166 * Callback for settings field. 2167 * 2168 * @return void 2169 */ 2143 2170 public function field_adcmdr_maxmind_database_update() { 2144 2171 if ( ProBridge::instance()->is_pro_loaded() ) { … … 2147 2174 } 2148 2175 2149 /**2150 * Callback for settings field.2151 *2152 * @return void2153 */2176 /** 2177 * Callback for settings field. 2178 * 2179 * @return void 2180 */ 2154 2181 public function field_adcmdr_render_method() { 2155 2182 $pro_only = array( 'clientside', 'smart' ); … … 2206 2233 } 2207 2234 2208 /**2209 * Callback for settings field.2210 *2211 * @return void2212 */2235 /** 2236 * Callback for settings field. 2237 * 2238 * @return void 2239 */ 2213 2240 public function field_adcmdr_ad_label() { 2214 2241 $id = array( $this->sf()->key( 'general' ) => 'ad_label' ); … … 2223 2250 } 2224 2251 2225 /**2226 * Callback for settings field.2227 *2228 * @return void2229 */2252 /** 2253 * Callback for settings field. 2254 * 2255 * @return void 2256 */ 2230 2257 public function field_adcmdr_prefix() { 2231 2258 $id = array( $this->sf()->key( 'general' ) => 'prefix' ); … … 2234 2261 } 2235 2262 2236 2237 /** 2238 * Callback for settings field. 2239 * 2240 * @return void 2241 */ 2263 /** 2264 * Callback for settings field. 2265 * 2266 * @return void 2267 */ 2242 2268 public function field_adcmdr_loading_animation() { 2243 2269 $id = array( $this->sf()->key( 'general' ) => 'loading_animation' ); … … 2248 2274 } 2249 2275 2250 /**2251 * Callback for settings field.2252 *2253 * @return void2254 */2276 /** 2277 * Callback for settings field. 2278 * 2279 * @return void 2280 */ 2255 2281 public function field_adcmdr_lazy_load_ads() { 2256 2282 $id = array( $this->sf()->key( 'general' ) => 'lazy_load_ads' ); … … 2281 2307 } 2282 2308 2283 /**2284 * Callback for settings field.2285 *2286 * @return void2287 */2309 /** 2310 * Callback for settings field. 2311 * 2312 * @return void 2313 */ 2288 2314 public function field_adcmdr_disable_onboarding_global() { 2289 2315 $id = array( $this->sf()->key( 'admin' ) => 'disable_onboarding_global' ); … … 2293 2319 } 2294 2320 2295 /**2296 * Callback for settings field.2297 *2298 * @return void2299 */2321 /** 2322 * Callback for settings field. 2323 * 2324 * @return void 2325 */ 2300 2326 public function field_adcmdr_disable_onboarding_ads() { 2301 2327 $id = array( $this->sf()->key( 'admin' ) => 'disable_onboarding_ads' ); … … 2305 2331 } 2306 2332 2307 /**2308 * Callback for settings field.2309 *2310 * @return void2311 */2333 /** 2334 * Callback for settings field. 2335 * 2336 * @return void 2337 */ 2312 2338 public function field_adcmdr_disable_doc_links() { 2313 2339 $id = array( $this->sf()->key( 'admin' ) => 'disable_doc_links' ); … … 2317 2343 } 2318 2344 2319 /**2320 * Callback for settings field.2321 *2322 * @return void2323 */2345 /** 2346 * Callback for settings field. 2347 * 2348 * @return void 2349 */ 2324 2350 public function field_adcmdr_disable_virtual_adstxt() { 2325 2351 $id = array( $this->sf()->key( 'general' ) => 'disable_virtual_adstxt' ); … … 2355 2381 } 2356 2382 2357 /**2358 * Callback for settings field.2359 *2360 * @return void2361 */2383 /** 2384 * Callback for settings field. 2385 * 2386 * @return void 2387 */ 2362 2388 public function field_adcmdr_ads_txt_records() { 2363 2389 $id = array( $this->sf()->key( 'general' ) => 'ads_txt_records' ); … … 2385 2411 } 2386 2412 2387 /**2388 * Callback for settings field.2389 *2390 * @return void2391 */2413 /** 2414 * Callback for settings field. 2415 * 2416 * @return void 2417 */ 2392 2418 public function field_adcmdr_newwindow() { 2393 2419 $id = array( $this->sf()->key( 'general' ) => 'newwindow' ); … … 2397 2423 } 2398 2424 2399 /**2400 * Callback for settings field.2401 *2402 * @return void2403 */2425 /** 2426 * Callback for settings field. 2427 * 2428 * @return void 2429 */ 2404 2430 public function field_adcmdr_rel_attributes() { 2405 2431 $id = array( $this->sf()->key( 'general' ) => 'rel_attributes' ); … … 2415 2441 } 2416 2442 2417 /**2418 * Callback for settings field.2419 *2420 * @return void2421 */2443 /** 2444 * Callback for settings field. 2445 * 2446 * @return void 2447 */ 2422 2448 public function field_adcmdr_responsive_banners() { 2423 2449 $id = array( $this->sf()->key( 'general' ) => 'responsive_banners' ); … … 2431 2457 } 2432 2458 2433 /**2434 * Callback for settings field.2435 *2436 * @return void2437 */2459 /** 2460 * Callback for settings field. 2461 * 2462 * @return void 2463 */ 2438 2464 public function field_adcmdr_filter_priority() { 2439 2465 $id = array( $this->sf()->key( 'general' ) => 'filter_priority' ); … … 2443 2469 } 2444 2470 2445 /**2446 * Callback for settings field.2447 *2448 * @return void2449 */2471 /** 2472 * Callback for settings field. 2473 * 2474 * @return void 2475 */ 2450 2476 public function field_adcmdr_disable_stylesheets() { 2451 2477 $id = array( $this->sf()->key( 'general' ) => 'disable_stylesheets' ); … … 2455 2481 } 2456 2482 2457 /**2458 * Callback for settings field.2459 *2460 * @return void2461 */2483 /** 2484 * Callback for settings field. 2485 * 2486 * @return void 2487 */ 2462 2488 public function field_adcmdr_bots_disable_ads() { 2463 2489 $id = array( $this->sf()->key( 'general' ) => 'bots_disable_ads' ); … … 2468 2494 } 2469 2495 2470 /**2471 * Callback for settings field.2472 *2473 * @return void2474 */2496 /** 2497 * Callback for settings field. 2498 * 2499 * @return void 2500 */ 2475 2501 public function field_adcmdr_disable_all() { 2476 2502 $id = array( $this->sf()->key( 'general' ) => 'disable_all' ); … … 2480 2506 } 2481 2507 2482 /**2483 * Callback for settings field.2484 *2485 * @return void2486 */2508 /** 2509 * Callback for settings field. 2510 * 2511 * @return void 2512 */ 2487 2513 public function field_adcmdr_disable_user_roles() { 2488 2514 $roles = TargetingVisitor::parse_roles_to_values(); … … 2492 2518 } 2493 2519 2494 /**2495 * Callback for settings field.2496 *2497 * @return void2498 */2520 /** 2521 * Callback for settings field. 2522 * 2523 * @return void 2524 */ 2499 2525 public function field_adcmdr_allow_editors() { 2500 2526 $id = array( $this->sf()->key( 'admin' ) => 'allow_editors' ); … … 2505 2531 } 2506 2532 2507 /**2508 * Callback for settings field.2509 *2510 * @return void2511 */2533 /** 2534 * Callback for settings field. 2535 * 2536 * @return void 2537 */ 2512 2538 public function field_adcmdr_allow_unfiltered_html() { 2513 2539 $id = array( $this->sf()->key( 'admin' ) => 'allow_unfiltered_html' ); … … 2518 2544 } 2519 2545 2520 /**2521 * Callback for settings field.2522 *2523 * @return void2524 */2546 /** 2547 * Callback for settings field. 2548 * 2549 * @return void 2550 */ 2525 2551 public function field_adcmdr_delete_data() { 2526 2552 $id = array( $this->sf()->key( 'admin' ) => 'delete_data' ); … … 2531 2557 } 2532 2558 2533 /**2534 * Callback for settings field.2535 *2536 * @return void2537 */2559 /** 2560 * Callback for settings field. 2561 * 2562 * @return void 2563 */ 2538 2564 public function field_adcmdr_disable_track_impressions() { 2539 2565 $id = array( $this->sf()->key( 'tracking' ) => 'disable_track_impressions' ); … … 2543 2569 } 2544 2570 2545 /**2546 * Callback for settings field.2547 *2548 * @return void2549 */2571 /** 2572 * Callback for settings field. 2573 * 2574 * @return void 2575 */ 2550 2576 public function field_adcmdr_disable_track_clicks() { 2551 2577 $id = array( $this->sf()->key( 'tracking' ) => 'disable_track_clicks' ); … … 2555 2581 } 2556 2582 2557 /**2558 * Callback for settings field.2559 *2560 * @return void2561 */2583 /** 2584 * Callback for settings field. 2585 * 2586 * @return void 2587 */ 2562 2588 public function field_adcmdr_enable_local_tracking() { 2563 2589 $id = array( $this->sf()->key( 'tracking' ) => 'enable_local_tracking' ); … … 2569 2595 } 2570 2596 2571 /**2572 * Callback for settings field.2573 *2574 * @return void2575 */2597 /** 2598 * Callback for settings field. 2599 * 2600 * @return void 2601 */ 2576 2602 public function field_adcmdr_enable_3p_tracking() { 2577 2603 $id = array( $this->sf()->key( 'tracking' ) => 'enable_3p_tracking' ); … … 2593 2619 } 2594 2620 2595 /**2596 * Callback for settings field.2597 *2598 * @return void2599 */2621 /** 2622 * Callback for settings field. 2623 * 2624 * @return void 2625 */ 2600 2626 public function field_adcmdr_enable_ga_tracking() { 2601 2627 $id = array( $this->sf()->key( 'tracking' ) => 'enable_ga_tracking' ); … … 2618 2644 } 2619 2645 2620 /**2621 * Callback for settings field.2622 *2623 * @return void2624 */2646 /** 2647 * Callback for settings field. 2648 * 2649 * @return void 2650 */ 2625 2651 public function field_adcmdr_ga_tracking_ids() { 2626 2652 $id = array( $this->sf()->key( 'tracking' ) => 'ga_tracking_ids' ); … … 2631 2657 } 2632 2658 2633 /**2634 * Callback for settings field.2635 *2636 * @return void2637 */2659 /** 2660 * Callback for settings field. 2661 * 2662 * @return void 2663 */ 2638 2664 public function field_adcmdr_ga_anonymize_ip() { 2639 2665 $id = array( $this->sf()->key( 'tracking' ) => 'ga_anonymize_ip' ); … … 2642 2668 } 2643 2669 2644 /**2645 * Callback for settings field.2646 *2647 * @return void2648 */2670 /** 2671 * Callback for settings field. 2672 * 2673 * @return void 2674 */ 2649 2675 public function field_adcmdr_disable_amp_analytics() { 2650 2676 $id = array( $this->sf()->key( 'tracking' ) => 'disable_amp_analytics' ); … … 2654 2680 } 2655 2681 2656 /**2657 * Callback for settings field.2658 *2659 * @return void2660 */2682 /** 2683 * Callback for settings field. 2684 * 2685 * @return void 2686 */ 2661 2687 public function field_adcmdr_disable_amp_pixel() { 2662 2688 $id = array( $this->sf()->key( 'tracking' ) => 'disable_amp_pixel' ); … … 2670 2696 } 2671 2697 2672 /**2673 * Callback for settings field.2674 *2675 * @return void2676 */2698 /** 2699 * Callback for settings field. 2700 * 2701 * @return void 2702 */ 2677 2703 public function field_adcmdr_bots_disable_tracking() { 2678 2704 $id = array( $this->sf()->key( 'tracking' ) => 'bots_disable_tracking' ); … … 2683 2709 } 2684 2710 2685 /**2686 * Callback for settings field.2687 *2688 * @return void2689 */2711 /** 2712 * Callback for settings field. 2713 * 2714 * @return void 2715 */ 2690 2716 public function field_adcmdr_adsense_account() { 2691 2717 $pub_id = $this->sf()->get( 'adsense_account', 'adsense' ); … … 2753 2779 ?> 2754 2780 </div> 2755 <?php2756 } 2757 2758 /**2759 * Call back for settings section.2760 *2761 * @return void2762 */2781 <?php 2782 } 2783 2784 /** 2785 * Call back for settings section. 2786 * 2787 * @return void 2788 */ 2763 2789 public function settings_callback_adcmdr_amp_defaults() { 2764 2790 ?> 2765 2791 2766 2792 <p><?php esc_html_e( 'These settings can be overridden by individual ads if needed.', 'ad-commander' ); ?></p> 2767 <?php2768 } 2769 2770 /**2771 * Call back for settings section.2772 *2773 * @return void2774 */2793 <?php 2794 } 2795 2796 /** 2797 * Call back for settings section. 2798 * 2799 * @return void 2800 */ 2775 2801 public function settings_callback_adcmdr_auto_ads() { 2776 2802 } 2777 2803 2778 /**2779 * Callback for settings field.2780 *2781 * @return void2782 */2804 /** 2805 * Callback for settings field. 2806 * 2807 * @return void 2808 */ 2783 2809 public function field_adcmdr_adsense_amp_ad_mode() { 2784 2810 $id = array( $this->sf()->key( 'adsense' ) => 'adsense_amp_ad_mode' ); … … 2798 2824 } 2799 2825 2800 2801 /** 2802 * Callback for settings field. 2803 * 2804 * @return void 2805 */ 2826 /** 2827 * Callback for settings field. 2828 * 2829 * @return void 2830 */ 2806 2831 public function field_adcmdr_insert_adsense_head_code() { 2807 2832 $id = array( $this->sf()->key( 'adsense' ) => 'insert_adsense_head_code' ); … … 2815 2840 } 2816 2841 2817 /**2818 * Callback for settings field.2819 *2820 * @return void2821 */2842 /** 2843 * Callback for settings field. 2844 * 2845 * @return void 2846 */ 2822 2847 public function field_adcmdr_enable_amp_auto_ads() { 2823 2848 $id = array( $this->sf()->key( 'adsense' ) => 'enable_amp_auto_ads' ); … … 2836 2861 } 2837 2862 2838 /**2839 * Callback for settings field.2840 *2841 * @return void2842 */2863 /** 2864 * Callback for settings field. 2865 * 2866 * @return void 2867 */ 2843 2868 public function field_adcmdr_disable_adsense_account_alerts() { 2844 2869 $pub_id = $this->sf()->get( 'adsense_account', 'adsense' ); … … 2851 2876 } 2852 2877 2853 2854 /** 2855 * Callback for settings field. 2856 * 2857 * @return void 2858 */ 2878 /** 2879 * Callback for settings field. 2880 * 2881 * @return void 2882 */ 2859 2883 public function field_adcmdr_consent_required() { 2860 2884 $id = array( $this->sf()->key( 'privacy' ) => 'consent_required' ); … … 2870 2894 } 2871 2895 2872 /**2873 * Callback for settings field.2874 *2875 * @return void2876 */2896 /** 2897 * Callback for settings field. 2898 * 2899 * @return void 2900 */ 2877 2901 public function field_adcmdr_consent_cookie_name() { 2878 2902 $id = array( $this->sf()->key( 'privacy' ) => 'consent_cookie_name' ); … … 2883 2907 } 2884 2908 2885 /**2886 * Callback for settings field.2887 *2888 * @return void2889 */2909 /** 2910 * Callback for settings field. 2911 * 2912 * @return void 2913 */ 2890 2914 public function field_adcmdr_consent_cookie_value() { 2891 2915 $id = array( $this->sf()->key( 'privacy' ) => 'consent_cookie_value' ); … … 2896 2920 } 2897 2921 2898 /**2899 * Callback for settings field.2900 *2901 * @return void2902 */2922 /** 2923 * Callback for settings field. 2924 * 2925 * @return void 2926 */ 2903 2927 public function field_adcmdr_consent_cookie_comparison() { 2904 2928 $options = array( … … 2921 2945 } 2922 2946 2923 /**2924 * Create classes for use on a meta item.2925 *2926 * @param array $suffixes An array of suffices to append.2927 *2928 * @return string2929 */2947 /** 2948 * Create classes for use on a meta item. 2949 * 2950 * @param array $suffixes An array of suffices to append. 2951 * 2952 * @return string 2953 */ 2930 2954 public static function metaitem_classes( $suffixes = array() ) { 2931 2955 $classes = array( 'adcmdr-metaitem' ); … … 2944 2968 } 2945 2969 2946 /**2947 * Interfaces with WOMeta message and adds classes.2948 *2949 * @param string $message The message to display.2950 * @param array $classes Any additional classes.2951 * @param array $args Additional arguments.2952 *2953 * @return string2954 */2970 /** 2971 * Interfaces with WOMeta message and adds classes. 2972 * 2973 * @param string $message The message to display. 2974 * @param array $classes Any additional classes. 2975 * @param array $args Additional arguments. 2976 * 2977 * @return string 2978 */ 2955 2979 protected function info( $message, $classes = array(), $args = array() ) { 2956 2980 $classes = Util::arrayify( $classes ); … … 2964 2988 } 2965 2989 2966 /**2967 * Display an add-on table.2968 *2969 * @return string2970 */2990 /** 2991 * Display an add-on table. 2992 * 2993 * @return string 2994 */ 2971 2995 protected function get_addons() { 2972 2996 $html = ''; … … 2993 3017 $html .= $this->start_div( Util::ns( 'addons' ), array( 'display' => false ) ) . 2994 3018 $this->start_div( array( Util::ns( 'addon-features' ), Util::ns( 'pro-features' ) ), array( 'display' => false ) ) . 2995 Html::h3( AdCommander::title() . ' Pro' ) .2996 Html::ul( $lis, Util::ns( 'addon' ) ) .2997 $this->start_div( 'adcmdr-btn-group', array( 'display' => false ) ) .2998 Html::abtn( self::pro_upgrade_url( array( 'utm_medium' => 'button' ) ), __( 'Upgrade to Pro', 'ad-commander' ) ) .2999 Html::abtn( AdCommander::public_site_url( '', array( 'utm_medium' => 'button' ) ), 'Learn more', '_blank', true ) .3000 $this->end_div( array( 'display' => false ) ) .3019 Html::h3( AdCommander::title() . ' Pro' ) . 3020 Html::ul( $lis, Util::ns( 'addon' ) ) . 3021 $this->start_div( 'adcmdr-btn-group', array( 'display' => false ) ) . 3022 Html::abtn( self::pro_upgrade_url( array( 'utm_medium' => 'button' ) ), __( 'Upgrade to Pro', 'ad-commander' ) ) . 3023 Html::abtn( AdCommander::public_site_url( '', array( 'utm_medium' => 'button' ) ), 'Learn more', '_blank', true ) . 3024 $this->end_div( array( 'display' => false ) ) . 3001 3025 $this->end_div( array( 'display' => false ) ) . 3002 3026 $this->end_div( array( 'display' => false ) ); … … 3019 3043 $html .= $this->start_div( Util::ns( 'addons' ), array( 'display' => false ) ) . 3020 3044 $this->start_div( Util::ns( 'addon-features' ), array( 'display' => false ) ) . 3021 Html::h3( __( 'Ad Commander Tools', 'ad-commander' ) ) .3022 Html::ul( $lis, Util::ns( 'addon' ) ) .3023 $this->start_div( 'adcmdr-btn-group', array( 'display' => false ) ) .3024 Html::abtn( AddonBridge::addon_url( 'tools' ), __( 'Download Add-on', 'ad-commander' ) ) .3025 $this->end_div( array( 'display' => false ) ) .3045 Html::h3( __( 'Ad Commander Tools', 'ad-commander' ) ) . 3046 Html::ul( $lis, Util::ns( 'addon' ) ) . 3047 $this->start_div( 'adcmdr-btn-group', array( 'display' => false ) ) . 3048 Html::abtn( AddonBridge::addon_url( 'tools' ), __( 'Download Add-on', 'ad-commander' ) ) . 3049 $this->end_div( array( 'display' => false ) ) . 3026 3050 $this->end_div( array( 'display' => false ) ) . 3027 3051 $this->end_div( array( 'display' => false ) ); … … 3035 3059 $html .= $this->start_div( Util::ns( 'addons' ), array( 'display' => false ) ) . 3036 3060 $this->start_div( Util::ns( 'addon-features' ), array( 'display' => false ) ) . 3037 Html::h3( __( 'Screen Stay Awake', 'ad-commander' ) ) .3038 Html::p( $p ) .3039 $this->start_div( 'adcmdr-btn-group', array( 'display' => false ) ) .3040 Html::abtn( AddonBridge::addon_url( 'scrnsa' ), __( 'Download Plugin', 'ad-commander' ) ) .3041 $this->end_div( array( 'display' => false ) ) .3061 Html::h3( __( 'Screen Stay Awake', 'ad-commander' ) ) . 3062 Html::p( $p ) . 3063 $this->start_div( 'adcmdr-btn-group', array( 'display' => false ) ) . 3064 Html::abtn( AddonBridge::addon_url( 'scrnsa' ), __( 'Download Plugin', 'ad-commander' ) ) . 3065 $this->end_div( array( 'display' => false ) ) . 3042 3066 $this->end_div( array( 'display' => false ) ) . 3043 3067 $this->end_div( array( 'display' => false ) ); … … 3051 3075 } 3052 3076 3053 /**3054 * Modify the ad or placement post title if it's blank.3055 *3056 * @param array $post_data The current post data.3057 *3058 * @return array3059 */3077 /** 3078 * Modify the ad or placement post title if it's blank. 3079 * 3080 * @param array $post_data The current post data. 3081 * 3082 * @return array 3083 */ 3060 3084 public function modify_post_title( $post_data ) { 3061 3085 -
ad-commander/tags/1.1.27/readme.txt
r3487808 r3487830 4 4 Requires at least: 6.2 5 5 Tested up to: 6.9 6 Stable tag: 1.1.2 66 Stable tag: 1.1.27 7 7 Requires PHP: 7.4 8 8 License: GPLv3 … … 119 119 120 120 == Changelog == 121 = 1.1.27 = 122 * Add geolocation information to debugging info 123 * Hide MaxMind license from debugging info 124 121 125 = 1.1.26 = 122 126 * Add system status tab to settings -
ad-commander/trunk/ad-commander.php
r3487808 r3487830 4 4 * Plugin URI: https://wpadcommander.com 5 5 * Description: Insert, schedule and track custom advertising banners or script ads from AdSense, Amazon, and other affiliate networks into your site. 6 * Version: 1.1.2 66 * Version: 1.1.27 7 7 * Author: Wild Operation 8 8 * Author URI: https://wildoperation.com … … 14 14 * @subpackage Ad Commander - Banner & Ad Manager 15 15 * @since 1.0.0 16 * @version 1.1.2 616 * @version 1.1.27 17 17 */ 18 18 -
ad-commander/trunk/includes/AdCommander.php
r3487808 r3487830 13 13 */ 14 14 public static function version() { 15 return '1.1.2 6';15 return '1.1.27'; 16 16 } 17 17 -
ad-commander/trunk/includes/Admin.php
r3487808 r3487830 1242 1242 <img src="<?php echo esc_url( AdCommander::assets_url() . 'img/logo.svg' ); ?>" alt="<?php echo esc_attr( AdCommander::title() ); ?>" class="adcmdr-logo" /> 1243 1243 <div class="adcmdr-btn-group"> 1244 <?php if ( ! ProBridge::instance()->is_pro_loaded() ) : ?>1244 <?php if ( ! ProBridge::instance()->is_pro_loaded() ) : ?> 1245 1245 <a href="<?php echo esc_url( AdCommander::public_site_url( '', array( 'utm_medium' => 'button' ) ) ); ?>" class="button button-adcmdr-primary" target="_blank"><?php esc_html_e( 'Get Pro', 'ad-commander' ); ?></a> 1246 1246 <?php endif; ?> … … 1250 1250 </div> 1251 1251 <?php 1252 endif;1252 endif; 1253 1253 } 1254 1254 … … 1347 1347 </div> 1348 1348 <div class="inside"> 1349 <?php echo wp_kses_post( $content ); ?>1349 <?php echo wp_kses_post( $content ); ?> 1350 1350 </div> 1351 1351 </div> … … 1403 1403 ?> 1404 1404 <h2><?php _e( 'System Information for Debugging', 'ad-commander' ); ?></h2> 1405 <p><?php _e( 'If you are experiencing issues with the plugin, please copy and paste the following information in your support request. This will help us to debug the issue.', 'ad-commander' ); ?></p> 1406 <p><?php _e( 'IMPORTANT: May contain your geolocation information if geotargeting is enabled.', 'ad-commander' ); ?></p> 1405 1407 <?php 1406 1408 $settings = self::settings(); … … 1438 1440 1439 1441 if ( ! empty( $group['sections'] ) ) { 1440 foreach ( $group['sections'] as $section ) {1442 foreach ( $group['sections'] as $section_key => $section ) { 1441 1443 if ( empty( $section['fields'] ) ) { 1442 1444 continue; … … 1451 1453 1452 1454 $value = isset( $raw_group[ $field_key ] ) ? $raw_group[ $field_key ] : null; 1453 $lines[] = $this->format_debug_line( $label, $this->format_debug_value( $value ) ); 1455 $lines[] = $this->format_debug_line( $label, $this->format_debug_value( $value, ( in_array( $field_key, array( 'maxmind_license_key', 'pro_license_key' ) ) ) ) ); 1456 } 1457 1458 if ( $section_key === 'geotargeting' && ProBridge::instance()->is_pro_loaded() ) { 1459 $visitor = GeoPro::instance()->get_visitor( true ); 1460 if ( $visitor && ! empty( $visitor ) ) { 1461 $lines[] = ''; 1462 $lines[] = '### ' . __( 'Current Visitor Geo', 'ad-commander' ); 1463 1464 $visitor_labels = array( 1465 'lookup_types' => __( 'Lookup Types', 'ad-commander' ), 1466 'city' => __( 'City', 'ad-commander' ), 1467 'region' => __( 'Region', 'ad-commander' ), 1468 'country_code' => __( 'Country Code', 'ad-commander' ), 1469 'continent_code' => __( 'Continent Code', 'ad-commander' ), 1470 'lat' => __( 'Latitude', 'ad-commander' ), 1471 'lng' => __( 'Longitude', 'ad-commander' ), 1472 ); 1473 1474 foreach ( $visitor_labels as $key => $label ) { 1475 if ( isset( $visitor[ $key ] ) ) { 1476 $value = is_array( $visitor[ $key ] ) ? implode( ', ', $visitor[ $key ] ) : $visitor[ $key ]; 1477 $lines[] = $this->format_debug_line( $label, $value ); 1478 } 1479 } 1480 } 1454 1481 } 1455 1482 } … … 1457 1484 } 1458 1485 1459 /**1460 * WordPress Environment1461 */1462 global $wpdb;1463 1464 $lines[] = '';1465 $lines[] = '## ' . __( 'WordPress Environment', 'ad-commander' );1466 $lines[] = '';1467 $lines[] = $this->format_debug_line( __( 'Home URL', 'ad-commander' ), home_url() );1468 $lines[] = $this->format_debug_line( __( 'Site URL', 'ad-commander' ), site_url() );1469 $lines[] = $this->format_debug_line( __( 'REST API Base URL', 'ad-commander' ), rest_url() );1470 $lines[] = $this->format_debug_line( __( 'WordPress Version', 'ad-commander' ), get_bloginfo( 'version' ) );1471 $lines[] = $this->format_debug_line( __( 'WordPress Multisite', 'ad-commander' ), is_multisite() ? __( 'Yes', 'ad-commander' ) : __( 'No', 'ad-commander' ) );1472 $lines[] = $this->format_debug_line( __( 'WordPress Memory Limit', 'ad-commander' ), WP_MEMORY_LIMIT );1473 $lines[] = $this->format_debug_line( __( 'WordPress Debug Mode', 'ad-commander' ), ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ? __( 'Yes', 'ad-commander' ) : __( 'No', 'ad-commander' ) );1474 $lines[] = $this->format_debug_line( __( 'WordPress Debug Log', 'ad-commander' ), ( defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG ) ? __( 'Yes', 'ad-commander' ) : __( 'No', 'ad-commander' ) );1475 $lines[] = $this->format_debug_line( __( 'WordPress Cron', 'ad-commander' ), ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) ? __( 'No', 'ad-commander' ) : __( 'Yes', 'ad-commander' ) );1476 $lines[] = $this->format_debug_line( __( 'WordPress Locale', 'ad-commander' ), get_locale() );1477 1478 /**1479 * Active Theme1480 */1481 $theme = wp_get_theme();1482 $theme_author = $theme->get( 'Author' );1483 $theme_detail = $theme_author ? 'by ' . wp_strip_all_tags( $theme_author ) . ' — ' . $theme->get( 'Version' ) : $theme->get( 'Version' );1484 1485 $lines[] = '';1486 $lines[] = '## ' . __( 'Active Theme', 'ad-commander' );1487 $lines[] = '';1488 $lines[] = $this->format_debug_line( $theme->get( 'Name' ), $theme_detail );1486 /** 1487 * WordPress Environment 1488 */ 1489 global $wpdb; 1490 1491 $lines[] = ''; 1492 $lines[] = '## ' . __( 'WordPress Environment', 'ad-commander' ); 1493 $lines[] = ''; 1494 $lines[] = $this->format_debug_line( __( 'Home URL', 'ad-commander' ), home_url() ); 1495 $lines[] = $this->format_debug_line( __( 'Site URL', 'ad-commander' ), site_url() ); 1496 $lines[] = $this->format_debug_line( __( 'REST API Base URL', 'ad-commander' ), rest_url() ); 1497 $lines[] = $this->format_debug_line( __( 'WordPress Version', 'ad-commander' ), get_bloginfo( 'version' ) ); 1498 $lines[] = $this->format_debug_line( __( 'WordPress Multisite', 'ad-commander' ), is_multisite() ? __( 'Yes', 'ad-commander' ) : __( 'No', 'ad-commander' ) ); 1499 $lines[] = $this->format_debug_line( __( 'WordPress Memory Limit', 'ad-commander' ), WP_MEMORY_LIMIT ); 1500 $lines[] = $this->format_debug_line( __( 'WordPress Debug Mode', 'ad-commander' ), ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ? __( 'Yes', 'ad-commander' ) : __( 'No', 'ad-commander' ) ); 1501 $lines[] = $this->format_debug_line( __( 'WordPress Debug Log', 'ad-commander' ), ( defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG ) ? __( 'Yes', 'ad-commander' ) : __( 'No', 'ad-commander' ) ); 1502 $lines[] = $this->format_debug_line( __( 'WordPress Cron', 'ad-commander' ), ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) ? __( 'No', 'ad-commander' ) : __( 'Yes', 'ad-commander' ) ); 1503 $lines[] = $this->format_debug_line( __( 'WordPress Locale', 'ad-commander' ), get_locale() ); 1504 1505 /** 1506 * Active Theme 1507 */ 1508 $theme = wp_get_theme(); 1509 $theme_author = $theme->get( 'Author' ); 1510 $theme_detail = $theme_author ? 'by ' . wp_strip_all_tags( $theme_author ) . ' — ' . $theme->get( 'Version' ) : $theme->get( 'Version' ); 1511 1512 $lines[] = ''; 1513 $lines[] = '## ' . __( 'Active Theme', 'ad-commander' ); 1514 $lines[] = ''; 1515 $lines[] = $this->format_debug_line( $theme->get( 'Name' ), $theme_detail ); 1489 1516 1490 1517 if ( $theme->parent() ) { … … 1492 1519 } 1493 1520 1494 /**1495 * Active Plugins1496 */1497 $active_plugins = get_option( 'active_plugins', array() );1498 $all_plugins = get_plugins();1499 1500 $lines[] = '';1501 $lines[] = '## ' . __( 'Active Plugins', 'ad-commander' );1502 $lines[] = '';1521 /** 1522 * Active Plugins 1523 */ 1524 $active_plugins = get_option( 'active_plugins', array() ); 1525 $all_plugins = get_plugins(); 1526 1527 $lines[] = ''; 1528 $lines[] = '## ' . __( 'Active Plugins', 'ad-commander' ); 1529 $lines[] = ''; 1503 1530 1504 1531 foreach ( $active_plugins as $plugin_path ) { … … 1511 1538 } 1512 1539 1513 /**1514 * Server Environment1515 */1516 $lines[] = '';1517 $lines[] = '## ' . __( 'Server Environment', 'ad-commander' );1518 $lines[] = '';1519 $lines[] = $this->format_debug_line( __( 'Web Server', 'ad-commander' ), isset( $_SERVER['SERVER_SOFTWARE'] ) ? sanitize_text_field( wp_unslash( $_SERVER['SERVER_SOFTWARE'] ) ) : __( 'Unknown', 'ad-commander' ) );1520 $lines[] = $this->format_debug_line( __( 'PHP Version', 'ad-commander' ), function_exists( 'phpversion' ) ? phpversion() : __( 'Unknown', 'ad-commander' ) );1521 $lines[] = $this->format_debug_line( __( 'PHP Memory Limit', 'ad-commander' ), function_exists( 'ini_get' ) ? ini_get( 'memory_limit' ) : __( 'Unknown', 'ad-commander' ) );1522 $lines[] = $this->format_debug_line( __( 'PHP Max Execution Time', 'ad-commander' ), function_exists( 'ini_get' ) ? ini_get( 'max_execution_time' ) : __( 'Unknown', 'ad-commander' ) );1523 $lines[] = $this->format_debug_line( __( 'PHP Max Upload Size', 'ad-commander' ), function_exists( 'ini_get' ) ? ini_get( 'upload_max_filesize' ) : __( 'Unknown', 'ad-commander' ) );1524 $lines[] = $this->format_debug_line( __( 'PHP Max Post Size', 'ad-commander' ), function_exists( 'ini_get' ) ? ini_get( 'post_max_size' ) : __( 'Unknown', 'ad-commander' ) );1525 $lines[] = $this->format_debug_line( __( 'cURL Enabled', 'ad-commander' ), function_exists( 'curl_version' ) ? __( 'Yes', 'ad-commander' ) . ' (' . curl_version()['version'] . ')' : __( 'No', 'ad-commander' ) );1526 $lines[] = $this->format_debug_line( __( 'OpenSSL', 'ad-commander' ), defined( 'OPENSSL_VERSION_TEXT' ) ? OPENSSL_VERSION_TEXT : __( 'No', 'ad-commander' ) );1527 1528 /**1529 * Database1530 */1531 $lines[] = '';1532 $lines[] = '## ' . __( 'Database', 'ad-commander' );1533 $lines[] = '';1534 $lines[] = $this->format_debug_line( __( 'Database System', 'ad-commander' ), ! empty( $wpdb->db_server_info() ) ? $wpdb->db_server_info() : __( 'Unknown', 'ad-commander' ) );1535 $lines[] = $this->format_debug_line( __( 'Database Version', 'ad-commander' ), $wpdb->db_version() );1536 $lines[] = $this->format_debug_line( __( 'Database Character Set', 'ad-commander' ), ! empty( $wpdb->charset ) ? $wpdb->charset : __( 'Unknown', 'ad-commander' ) );1537 $lines[] = $this->format_debug_line( __( 'Database Collation', 'ad-commander' ), ! empty( $wpdb->collate ) ? $wpdb->collate : __( 'Unknown', 'ad-commander' ) );1538 $lines[] = $this->format_debug_line( __( 'Database Prefix', 'ad-commander' ), $wpdb->prefix );1539 1540 /**1541 * Date and Time1542 */1543 $lines[] = '';1544 $lines[] = '## ' . __( 'Date and Time', 'ad-commander' );1545 $lines[] = '';1546 $lines[] = $this->format_debug_line( __( 'WordPress Timezone', 'ad-commander' ), wp_timezone_string() );1547 $lines[] = $this->format_debug_line( __( 'Server Time (UTC)', 'ad-commander' ), gmdate( 'Y-m-d H:i:s' ) );1548 $lines[] = $this->format_debug_line( __( 'Local Time', 'ad-commander' ), wp_date( 'Y-m-d H:i:s' ) );1549 1550 $output = implode( "\n", $lines );1540 /** 1541 * Server Environment 1542 */ 1543 $lines[] = ''; 1544 $lines[] = '## ' . __( 'Server Environment', 'ad-commander' ); 1545 $lines[] = ''; 1546 $lines[] = $this->format_debug_line( __( 'Web Server', 'ad-commander' ), isset( $_SERVER['SERVER_SOFTWARE'] ) ? sanitize_text_field( wp_unslash( $_SERVER['SERVER_SOFTWARE'] ) ) : __( 'Unknown', 'ad-commander' ) ); 1547 $lines[] = $this->format_debug_line( __( 'PHP Version', 'ad-commander' ), function_exists( 'phpversion' ) ? phpversion() : __( 'Unknown', 'ad-commander' ) ); 1548 $lines[] = $this->format_debug_line( __( 'PHP Memory Limit', 'ad-commander' ), function_exists( 'ini_get' ) ? ini_get( 'memory_limit' ) : __( 'Unknown', 'ad-commander' ) ); 1549 $lines[] = $this->format_debug_line( __( 'PHP Max Execution Time', 'ad-commander' ), function_exists( 'ini_get' ) ? ini_get( 'max_execution_time' ) : __( 'Unknown', 'ad-commander' ) ); 1550 $lines[] = $this->format_debug_line( __( 'PHP Max Upload Size', 'ad-commander' ), function_exists( 'ini_get' ) ? ini_get( 'upload_max_filesize' ) : __( 'Unknown', 'ad-commander' ) ); 1551 $lines[] = $this->format_debug_line( __( 'PHP Max Post Size', 'ad-commander' ), function_exists( 'ini_get' ) ? ini_get( 'post_max_size' ) : __( 'Unknown', 'ad-commander' ) ); 1552 $lines[] = $this->format_debug_line( __( 'cURL Enabled', 'ad-commander' ), function_exists( 'curl_version' ) ? __( 'Yes', 'ad-commander' ) . ' (' . curl_version()['version'] . ')' : __( 'No', 'ad-commander' ) ); 1553 $lines[] = $this->format_debug_line( __( 'OpenSSL', 'ad-commander' ), defined( 'OPENSSL_VERSION_TEXT' ) ? OPENSSL_VERSION_TEXT : __( 'No', 'ad-commander' ) ); 1554 1555 /** 1556 * Database 1557 */ 1558 $lines[] = ''; 1559 $lines[] = '## ' . __( 'Database', 'ad-commander' ); 1560 $lines[] = ''; 1561 $lines[] = $this->format_debug_line( __( 'Database System', 'ad-commander' ), ! empty( $wpdb->db_server_info() ) ? $wpdb->db_server_info() : __( 'Unknown', 'ad-commander' ) ); 1562 $lines[] = $this->format_debug_line( __( 'Database Version', 'ad-commander' ), $wpdb->db_version() ); 1563 $lines[] = $this->format_debug_line( __( 'Database Character Set', 'ad-commander' ), ! empty( $wpdb->charset ) ? $wpdb->charset : __( 'Unknown', 'ad-commander' ) ); 1564 $lines[] = $this->format_debug_line( __( 'Database Collation', 'ad-commander' ), ! empty( $wpdb->collate ) ? $wpdb->collate : __( 'Unknown', 'ad-commander' ) ); 1565 $lines[] = $this->format_debug_line( __( 'Database Prefix', 'ad-commander' ), $wpdb->prefix ); 1566 1567 /** 1568 * Date and Time 1569 */ 1570 $lines[] = ''; 1571 $lines[] = '## ' . __( 'Date and Time', 'ad-commander' ); 1572 $lines[] = ''; 1573 $lines[] = $this->format_debug_line( __( 'WordPress Timezone', 'ad-commander' ), wp_timezone_string() ); 1574 $lines[] = $this->format_debug_line( __( 'Server Time (UTC)', 'ad-commander' ), gmdate( 'Y-m-d H:i:s' ) ); 1575 $lines[] = $this->format_debug_line( __( 'Local Time', 'ad-commander' ), wp_date( 'Y-m-d H:i:s' ) ); 1576 1577 $output = implode( "\n", $lines ); 1551 1578 ?> 1552 1579 <div class="adcmdr-debug"> … … 1554 1581 <textarea readonly="readonly" onclick="this.select();"><?php echo esc_textarea( $output ); ?></textarea> 1555 1582 </div> 1556 <?php1557 } 1558 1559 /**1560 * Format a single line for the debug textarea.1561 *1562 * @param string $label The label.1563 * @param string $value The value.1564 *1565 * @return string1566 */1583 <?php 1584 } 1585 1586 /** 1587 * Format a single line for the debug textarea. 1588 * 1589 * @param string $label The label. 1590 * @param string $value The value. 1591 * 1592 * @return string 1593 */ 1567 1594 private function format_debug_line( $label, $value ) { 1568 return $label . ': ' . $value;1569 } 1570 1571 /**1572 * Format a value for debug display.1573 *1574 * @param mixed $value The value to format.1575 *1576 * @return string1577 */1578 private function format_debug_value( $value ) {1595 return esc_html( $label ) . ': ' . esc_html( $value ); 1596 } 1597 1598 /** 1599 * Format a value for debug display. 1600 * 1601 * @param mixed $value The value to format. 1602 * 1603 * @return string 1604 */ 1605 private function format_debug_value( $value, $exists_only = false ) { 1579 1606 if ( is_null( $value ) || ( is_string( $value ) && '' === $value ) ) { 1580 1607 return '—'; 1581 1608 } 1582 1609 1583 if ( is_bool( $value ) ) {1610 if ( is_bool( $value ) || ( $exists_only && ! empty( $value ) ) ) { 1584 1611 return $value ? __( 'Yes', 'ad-commander' ) : __( 'No', 'ad-commander' ); 1585 1612 } … … 1612 1639 } 1613 1640 1614 /**1615 * Register settings from settings array.1616 *1617 * @return void1618 */1641 /** 1642 * Register settings from settings array. 1643 * 1644 * @return void 1645 */ 1619 1646 public function register_settings() { 1620 1647 $this->sf()->add_sections_and_settings( … … 1624 1651 } 1625 1652 1626 /**1627 * Sanitize input by type.1628 *1629 * @param array $input The input to sanitize.1630 *1631 * @return array1632 */1653 /** 1654 * Sanitize input by type. 1655 * 1656 * @param array $input The input to sanitize. 1657 * 1658 * @return array 1659 */ 1633 1660 private function sanitize_by_key_type( $input ) { 1634 1661 $output = array(); … … 1677 1704 } 1678 1705 1679 /**1680 * Sanitize general group.1681 *1682 * @param array $input The input to sanitize.1683 *1684 * @return array1685 */1706 /** 1707 * Sanitize general group. 1708 * 1709 * @param array $input The input to sanitize. 1710 * 1711 * @return array 1712 */ 1686 1713 public function sanitize_adcmdr_general( $input ) { 1687 1714 Maintenance::flush_css_transients(); … … 1689 1716 } 1690 1717 1691 /**1692 * Sanitize admin group.1693 *1694 * @param array $input The input to sanitize.1695 *1696 * @return array1697 */1718 /** 1719 * Sanitize admin group. 1720 * 1721 * @param array $input The input to sanitize. 1722 * 1723 * @return array 1724 */ 1698 1725 public function sanitize_adcmdr_admin( $input ) { 1699 1726 return $this->sanitize_by_key_type( $input ); 1700 1727 } 1701 1728 1702 /**1703 * Sanitize tracking group.1704 *1705 * @param array $input The input to sanitize.1706 *1707 * @return array1708 */1729 /** 1730 * Sanitize tracking group. 1731 * 1732 * @param array $input The input to sanitize. 1733 * 1734 * @return array 1735 */ 1709 1736 public function sanitize_adcmdr_tracking( $input ) { 1710 1737 return $this->sanitize_by_key_type( $input ); 1711 1738 } 1712 1739 1713 /**1714 * Sanitize adsense group.1715 *1716 * @param array $input The input to sanitize.1717 *1718 * @return array1719 */1740 /** 1741 * Sanitize adsense group. 1742 * 1743 * @param array $input The input to sanitize. 1744 * 1745 * @return array 1746 */ 1720 1747 public function sanitize_adcmdr_adsense( $input ) { 1721 1748 return $this->sanitize_by_key_type( $input ); 1722 1749 } 1723 1750 1724 /**1725 * Sanitize privacy group.1726 *1727 * @param array $input The input to sanitize.1728 *1729 * @return array1730 */1751 /** 1752 * Sanitize privacy group. 1753 * 1754 * @param array $input The input to sanitize. 1755 * 1756 * @return array 1757 */ 1731 1758 public function sanitize_adcmdr_privacy( $input ) { 1732 1759 return $this->sanitize_by_key_type( $input ); 1733 1760 } 1734 1761 1735 /**1736 * Sanitize geotargeting group.1737 *1738 * @param array $input The input to sanitize.1739 *1740 * @return array1741 */1762 /** 1763 * Sanitize geotargeting group. 1764 * 1765 * @param array $input The input to sanitize. 1766 * 1767 * @return array 1768 */ 1742 1769 public function sanitize_adcmdr_targeting( $input ) { 1743 1770 return $this->sanitize_by_key_type( $input ); 1744 1771 } 1745 1772 1746 /**1747 * Sanitize add-on group.1748 *1749 * @param array $input The input to sanitize.1750 *1751 * @return array1752 */1773 /** 1774 * Sanitize add-on group. 1775 * 1776 * @param array $input The input to sanitize. 1777 * 1778 * @return array 1779 */ 1753 1780 public function sanitize_adcmdr_addons( $input ) { 1754 1781 return $this->sanitize_by_key_type( $input ); 1755 1782 } 1756 1783 1757 /**1758 * Create an underscored key from a string.1759 *1760 * @param string $key The key to convert.1761 *1762 * @return string1763 */1784 /** 1785 * Create an underscored key from a string. 1786 * 1787 * @param string $key The key to convert. 1788 * 1789 * @return string 1790 */ 1764 1791 public function _key( $key ) { 1765 1792 return str_replace( '-', '_', $key ); 1766 1793 } 1767 1794 1768 /**1769 * Create a nonce array.1770 * This is not an actual nonce. This array is used for creating and checking unique nonces.1771 *1772 * @param string $action The action..1773 * @param string $key The key to create the nonce string from.1774 *1775 * @return array1776 */1795 /** 1796 * Create a nonce array. 1797 * This is not an actual nonce. This array is used for creating and checking unique nonces. 1798 * 1799 * @param string $action The action.. 1800 * @param string $key The key to create the nonce string from. 1801 * 1802 * @return array 1803 */ 1777 1804 protected function nonce( $action, $key ) { 1778 1805 return array( … … 1782 1809 } 1783 1810 1784 /**1785 * Create a nonce field.1786 *1787 * @param array $nonce_arr A nonce array.1788 * @param bool $referrer Whether to include the referrer field.1789 *1790 * @return void1791 */1811 /** 1812 * Create a nonce field. 1813 * 1814 * @param array $nonce_arr A nonce array. 1815 * @param bool $referrer Whether to include the referrer field. 1816 * 1817 * @return void 1818 */ 1792 1819 protected function nonce_field( $nonce_arr, $referrer = false ) { 1793 1820 wp_nonce_field( $nonce_arr['action'], $nonce_arr['name'], $referrer ); 1794 1821 } 1795 1822 1796 /**1797 * Create a string for use in your nonce.1798 *1799 * @param string $action Action name.1800 *1801 * @return string1802 */1823 /** 1824 * Create a string for use in your nonce. 1825 * 1826 * @param string $action Action name. 1827 * 1828 * @return string 1829 */ 1803 1830 protected function nonce_string( $action ) { 1804 1831 return sanitize_title( Util::ns( 'n-' . $action ) ); 1805 1832 } 1806 1833 1807 /**1808 * Create an action string for use in your nonce.1809 *1810 * @param string $action Action name.1811 *1812 * @return string1813 */1834 /** 1835 * Create an action string for use in your nonce. 1836 * 1837 * @param string $action Action name. 1838 * 1839 * @return string 1840 */ 1814 1841 protected function action_string( $action ) { 1815 1842 return self::_key( sanitize_title( Util::ns( $action, '_' ) ) ); 1816 1843 } 1817 1844 1818 /**1819 * Authorizes actions for non-settings pages.1820 * Interfaces with WOAdmin to check nonce, capability, and required $_POST keys.1821 *1822 * @param mixed $action_key The action key to authorized.1823 * @param array $required_post Any required post keys.1824 * @param string|bool $capability The capability required to process this action.1825 *1826 * @return void1827 */1845 /** 1846 * Authorizes actions for non-settings pages. 1847 * Interfaces with WOAdmin to check nonce, capability, and required $_POST keys. 1848 * 1849 * @param mixed $action_key The action key to authorized. 1850 * @param array $required_post Any required post keys. 1851 * @param string|bool $capability The capability required to process this action. 1852 * 1853 * @return void 1854 */ 1828 1855 protected function check_ajax_action( $action_key, $required_post = array(), $capability = false ) { 1829 1856 /** … … 1840 1867 } 1841 1868 1842 /**1843 * Call back for settings section.1844 *1845 * @return void1846 */1869 /** 1870 * Call back for settings section. 1871 * 1872 * @return void 1873 */ 1847 1874 public function settings_callback_adcmdr_defaults() { 1848 1875 ?> 1849 1876 1850 1877 <p><?php esc_html_e( 'These settings can be overridden by individual ads if needed.', 'ad-commander' ); ?></p> 1851 <?php1852 } 1853 1854 /**1855 * Call back for settings section.1856 *1857 * @return void1858 */1878 <?php 1879 } 1880 1881 /** 1882 * Call back for settings section. 1883 * 1884 * @return void 1885 */ 1859 1886 public function settings_callback_adcmdr_consent() { 1860 1887 if ( Util::render_method() === 'serverside' ) { … … 1864 1891 ?> 1865 1892 <p><?php esc_html_e( 'Ad Commander does not create a consent banner. These settings allow you to integrate with a consent management plugin.', 'ad-commander' ); ?></p> 1866 <?php1867 } 1868 1869 /**1870 * Call back for settings section.1871 *1872 * @return void1873 */1893 <?php 1894 } 1895 1896 /** 1897 * Call back for settings section. 1898 * 1899 * @return void 1900 */ 1874 1901 public function settings_callback_adcmdr_general() {} 1875 1902 1876 /**1877 * Call back for settings section.1878 *1879 * @return void1880 */1903 /** 1904 * Call back for settings section. 1905 * 1906 * @return void 1907 */ 1881 1908 public function settings_callback_adcmdr_tracking_methods() {} 1882 1909 1883 /**1884 * Call back for settings section.1885 *1886 * @return void1887 */1910 /** 1911 * Call back for settings section. 1912 * 1913 * @return void 1914 */ 1888 1915 public function settings_callback_adcmdr_disable_ads() {} 1889 1916 1890 /**1891 * Call back for settings section.1892 *1893 * @return void1894 */1917 /** 1918 * Call back for settings section. 1919 * 1920 * @return void 1921 */ 1895 1922 public function settings_callback_adcmdr_advanced_settings() {} 1896 1923 1897 /**1898 * Call back for settings section.1899 *1900 * @return void1901 */1924 /** 1925 * Call back for settings section. 1926 * 1927 * @return void 1928 */ 1902 1929 public function settings_callback_adcmdr_admin() { 1903 1930 } 1904 1931 1905 /**1906 * Call back for settings section.1907 *1908 * @return void1909 */1932 /** 1933 * Call back for settings section. 1934 * 1935 * @return void 1936 */ 1910 1937 public function settings_callback_adcmdr_notifications() {} 1911 1938 1912 /**1913 * Call back for settings section.1914 *1915 * @return void1916 */1939 /** 1940 * Call back for settings section. 1941 * 1942 * @return void 1943 */ 1917 1944 public function settings_callback_adcmdr_misc() {} 1918 1945 1919 /**1920 * Call back for settings section.1921 *1922 * @return void1923 */1946 /** 1947 * Call back for settings section. 1948 * 1949 * @return void 1950 */ 1924 1951 public function settings_callback_adcmdr_onboarding() {} 1925 1952 1926 /**1927 * Call back for settings section.1928 *1929 * @return void1930 */1953 /** 1954 * Call back for settings section. 1955 * 1956 * @return void 1957 */ 1931 1958 public function settings_callback_adcmdr_geotargeting() {} 1932 1959 1933 /**1934 * Call back for settings section.1935 *1936 * @return void1937 */1960 /** 1961 * Call back for settings section. 1962 * 1963 * @return void 1964 */ 1938 1965 public function settings_callback_adcmdr_multisite() {} 1939 1966 1940 /**1941 * Call back for settings section.1942 *1943 * @return void1944 */1967 /** 1968 * Call back for settings section. 1969 * 1970 * @return void 1971 */ 1945 1972 public function settings_callback_adcmdr_ads_txt() { 1946 1973 ?> 1947 1974 <p><?php esc_html_e( 'Ad Commander will attempt to generate an ads.txt in the root of your website. If an AdSense account is enabled, it will be included, along with any additional records added below.', 'ad-commander' ); ?></p> 1948 <?php1949 } 1950 1951 /**1952 * Call back for settings section.1953 *1954 * @return void1955 */1975 <?php 1976 } 1977 1978 /** 1979 * Call back for settings section. 1980 * 1981 * @return void 1982 */ 1956 1983 public function settings_callback_adcmdr_disable_tracking() { 1957 1984 ?> 1958 1985 <p><?php esc_html_e( 'Fine-tune tracking settings by disabling some features below.', 'ad-commander' ); ?></p> 1959 <?php1960 } 1961 1962 /**1963 * Call back for settings section.1964 *1965 * @return void1966 */1986 <?php 1987 } 1988 1989 /** 1990 * Call back for settings section. 1991 * 1992 * @return void 1993 */ 1967 1994 public function settings_callback_adcmdr_tracking() {} 1968 1995 1969 /**1970 * Call back for settings section.1971 *1972 * @return void1973 */1996 /** 1997 * Call back for settings section. 1998 * 1999 * @return void 2000 */ 1974 2001 public function settings_callback_adcmdr_licenses() {} 1975 2002 1976 /**1977 * Call back for settings section.1978 *1979 * @return void1980 */2003 /** 2004 * Call back for settings section. 2005 * 2006 * @return void 2007 */ 1981 2008 public function settings_callback_adcmdr_support() {} 1982 2009 1983 /**1984 * Call back for settings section.1985 *1986 * @return void1987 */2010 /** 2011 * Call back for settings section. 2012 * 2013 * @return void 2014 */ 1988 2015 public function settings_callback_adcmdr_adsense() {} 1989 2016 1990 /**1991 * Perform actions during add-on options updates.1992 * Specifically, determine if the license key has changed.1993 *1994 * @param mixed $new_value The new value of the option.1995 * @param mixed $old_value The old value of the option.1996 *1997 * @return mixed1998 */2017 /** 2018 * Perform actions during add-on options updates. 2019 * Specifically, determine if the license key has changed. 2020 * 2021 * @param mixed $new_value The new value of the option. 2022 * @param mixed $old_value The old value of the option. 2023 * 2024 * @return mixed 2025 */ 1999 2026 public function addon_options_updated( $new_value, $old_value ) { 2000 2027 … … 2018 2045 } 2019 2046 2020 /**2021 * Callback for settings field.2022 *2023 * @return void2024 */2047 /** 2048 * Callback for settings field. 2049 * 2050 * @return void 2051 */ 2025 2052 public function field_adcmdr_pro_license_key() { 2026 2053 $pro_bridge = ProBridge::instance(); … … 2086 2113 } 2087 2114 2088 /**2089 * Callback for settings field.2090 *2091 * @return void2092 */2115 /** 2116 * Callback for settings field. 2117 * 2118 * @return void 2119 */ 2093 2120 public function field_adcmdr_geo_service() { 2094 2121 $id = array( $this->sf()->key( 'targeting' ) => 'geo_service' ); … … 2125 2152 } 2126 2153 2127 /**2128 * Callback for settings field.2129 *2130 * @return void2131 */2154 /** 2155 * Callback for settings field. 2156 * 2157 * @return void 2158 */ 2132 2159 public function field_adcmdr_maxmind_license_key() { 2133 2160 if ( ProBridge::instance()->is_pro_loaded() ) { … … 2136 2163 } 2137 2164 2138 /**2139 * Callback for settings field.2140 *2141 * @return void2142 */2165 /** 2166 * Callback for settings field. 2167 * 2168 * @return void 2169 */ 2143 2170 public function field_adcmdr_maxmind_database_update() { 2144 2171 if ( ProBridge::instance()->is_pro_loaded() ) { … … 2147 2174 } 2148 2175 2149 /**2150 * Callback for settings field.2151 *2152 * @return void2153 */2176 /** 2177 * Callback for settings field. 2178 * 2179 * @return void 2180 */ 2154 2181 public function field_adcmdr_render_method() { 2155 2182 $pro_only = array( 'clientside', 'smart' ); … … 2206 2233 } 2207 2234 2208 /**2209 * Callback for settings field.2210 *2211 * @return void2212 */2235 /** 2236 * Callback for settings field. 2237 * 2238 * @return void 2239 */ 2213 2240 public function field_adcmdr_ad_label() { 2214 2241 $id = array( $this->sf()->key( 'general' ) => 'ad_label' ); … … 2223 2250 } 2224 2251 2225 /**2226 * Callback for settings field.2227 *2228 * @return void2229 */2252 /** 2253 * Callback for settings field. 2254 * 2255 * @return void 2256 */ 2230 2257 public function field_adcmdr_prefix() { 2231 2258 $id = array( $this->sf()->key( 'general' ) => 'prefix' ); … … 2234 2261 } 2235 2262 2236 2237 /** 2238 * Callback for settings field. 2239 * 2240 * @return void 2241 */ 2263 /** 2264 * Callback for settings field. 2265 * 2266 * @return void 2267 */ 2242 2268 public function field_adcmdr_loading_animation() { 2243 2269 $id = array( $this->sf()->key( 'general' ) => 'loading_animation' ); … … 2248 2274 } 2249 2275 2250 /**2251 * Callback for settings field.2252 *2253 * @return void2254 */2276 /** 2277 * Callback for settings field. 2278 * 2279 * @return void 2280 */ 2255 2281 public function field_adcmdr_lazy_load_ads() { 2256 2282 $id = array( $this->sf()->key( 'general' ) => 'lazy_load_ads' ); … … 2281 2307 } 2282 2308 2283 /**2284 * Callback for settings field.2285 *2286 * @return void2287 */2309 /** 2310 * Callback for settings field. 2311 * 2312 * @return void 2313 */ 2288 2314 public function field_adcmdr_disable_onboarding_global() { 2289 2315 $id = array( $this->sf()->key( 'admin' ) => 'disable_onboarding_global' ); … … 2293 2319 } 2294 2320 2295 /**2296 * Callback for settings field.2297 *2298 * @return void2299 */2321 /** 2322 * Callback for settings field. 2323 * 2324 * @return void 2325 */ 2300 2326 public function field_adcmdr_disable_onboarding_ads() { 2301 2327 $id = array( $this->sf()->key( 'admin' ) => 'disable_onboarding_ads' ); … … 2305 2331 } 2306 2332 2307 /**2308 * Callback for settings field.2309 *2310 * @return void2311 */2333 /** 2334 * Callback for settings field. 2335 * 2336 * @return void 2337 */ 2312 2338 public function field_adcmdr_disable_doc_links() { 2313 2339 $id = array( $this->sf()->key( 'admin' ) => 'disable_doc_links' ); … … 2317 2343 } 2318 2344 2319 /**2320 * Callback for settings field.2321 *2322 * @return void2323 */2345 /** 2346 * Callback for settings field. 2347 * 2348 * @return void 2349 */ 2324 2350 public function field_adcmdr_disable_virtual_adstxt() { 2325 2351 $id = array( $this->sf()->key( 'general' ) => 'disable_virtual_adstxt' ); … … 2355 2381 } 2356 2382 2357 /**2358 * Callback for settings field.2359 *2360 * @return void2361 */2383 /** 2384 * Callback for settings field. 2385 * 2386 * @return void 2387 */ 2362 2388 public function field_adcmdr_ads_txt_records() { 2363 2389 $id = array( $this->sf()->key( 'general' ) => 'ads_txt_records' ); … … 2385 2411 } 2386 2412 2387 /**2388 * Callback for settings field.2389 *2390 * @return void2391 */2413 /** 2414 * Callback for settings field. 2415 * 2416 * @return void 2417 */ 2392 2418 public function field_adcmdr_newwindow() { 2393 2419 $id = array( $this->sf()->key( 'general' ) => 'newwindow' ); … … 2397 2423 } 2398 2424 2399 /**2400 * Callback for settings field.2401 *2402 * @return void2403 */2425 /** 2426 * Callback for settings field. 2427 * 2428 * @return void 2429 */ 2404 2430 public function field_adcmdr_rel_attributes() { 2405 2431 $id = array( $this->sf()->key( 'general' ) => 'rel_attributes' ); … … 2415 2441 } 2416 2442 2417 /**2418 * Callback for settings field.2419 *2420 * @return void2421 */2443 /** 2444 * Callback for settings field. 2445 * 2446 * @return void 2447 */ 2422 2448 public function field_adcmdr_responsive_banners() { 2423 2449 $id = array( $this->sf()->key( 'general' ) => 'responsive_banners' ); … … 2431 2457 } 2432 2458 2433 /**2434 * Callback for settings field.2435 *2436 * @return void2437 */2459 /** 2460 * Callback for settings field. 2461 * 2462 * @return void 2463 */ 2438 2464 public function field_adcmdr_filter_priority() { 2439 2465 $id = array( $this->sf()->key( 'general' ) => 'filter_priority' ); … … 2443 2469 } 2444 2470 2445 /**2446 * Callback for settings field.2447 *2448 * @return void2449 */2471 /** 2472 * Callback for settings field. 2473 * 2474 * @return void 2475 */ 2450 2476 public function field_adcmdr_disable_stylesheets() { 2451 2477 $id = array( $this->sf()->key( 'general' ) => 'disable_stylesheets' ); … … 2455 2481 } 2456 2482 2457 /**2458 * Callback for settings field.2459 *2460 * @return void2461 */2483 /** 2484 * Callback for settings field. 2485 * 2486 * @return void 2487 */ 2462 2488 public function field_adcmdr_bots_disable_ads() { 2463 2489 $id = array( $this->sf()->key( 'general' ) => 'bots_disable_ads' ); … … 2468 2494 } 2469 2495 2470 /**2471 * Callback for settings field.2472 *2473 * @return void2474 */2496 /** 2497 * Callback for settings field. 2498 * 2499 * @return void 2500 */ 2475 2501 public function field_adcmdr_disable_all() { 2476 2502 $id = array( $this->sf()->key( 'general' ) => 'disable_all' ); … … 2480 2506 } 2481 2507 2482 /**2483 * Callback for settings field.2484 *2485 * @return void2486 */2508 /** 2509 * Callback for settings field. 2510 * 2511 * @return void 2512 */ 2487 2513 public function field_adcmdr_disable_user_roles() { 2488 2514 $roles = TargetingVisitor::parse_roles_to_values(); … … 2492 2518 } 2493 2519 2494 /**2495 * Callback for settings field.2496 *2497 * @return void2498 */2520 /** 2521 * Callback for settings field. 2522 * 2523 * @return void 2524 */ 2499 2525 public function field_adcmdr_allow_editors() { 2500 2526 $id = array( $this->sf()->key( 'admin' ) => 'allow_editors' ); … … 2505 2531 } 2506 2532 2507 /**2508 * Callback for settings field.2509 *2510 * @return void2511 */2533 /** 2534 * Callback for settings field. 2535 * 2536 * @return void 2537 */ 2512 2538 public function field_adcmdr_allow_unfiltered_html() { 2513 2539 $id = array( $this->sf()->key( 'admin' ) => 'allow_unfiltered_html' ); … … 2518 2544 } 2519 2545 2520 /**2521 * Callback for settings field.2522 *2523 * @return void2524 */2546 /** 2547 * Callback for settings field. 2548 * 2549 * @return void 2550 */ 2525 2551 public function field_adcmdr_delete_data() { 2526 2552 $id = array( $this->sf()->key( 'admin' ) => 'delete_data' ); … … 2531 2557 } 2532 2558 2533 /**2534 * Callback for settings field.2535 *2536 * @return void2537 */2559 /** 2560 * Callback for settings field. 2561 * 2562 * @return void 2563 */ 2538 2564 public function field_adcmdr_disable_track_impressions() { 2539 2565 $id = array( $this->sf()->key( 'tracking' ) => 'disable_track_impressions' ); … … 2543 2569 } 2544 2570 2545 /**2546 * Callback for settings field.2547 *2548 * @return void2549 */2571 /** 2572 * Callback for settings field. 2573 * 2574 * @return void 2575 */ 2550 2576 public function field_adcmdr_disable_track_clicks() { 2551 2577 $id = array( $this->sf()->key( 'tracking' ) => 'disable_track_clicks' ); … … 2555 2581 } 2556 2582 2557 /**2558 * Callback for settings field.2559 *2560 * @return void2561 */2583 /** 2584 * Callback for settings field. 2585 * 2586 * @return void 2587 */ 2562 2588 public function field_adcmdr_enable_local_tracking() { 2563 2589 $id = array( $this->sf()->key( 'tracking' ) => 'enable_local_tracking' ); … … 2569 2595 } 2570 2596 2571 /**2572 * Callback for settings field.2573 *2574 * @return void2575 */2597 /** 2598 * Callback for settings field. 2599 * 2600 * @return void 2601 */ 2576 2602 public function field_adcmdr_enable_3p_tracking() { 2577 2603 $id = array( $this->sf()->key( 'tracking' ) => 'enable_3p_tracking' ); … … 2593 2619 } 2594 2620 2595 /**2596 * Callback for settings field.2597 *2598 * @return void2599 */2621 /** 2622 * Callback for settings field. 2623 * 2624 * @return void 2625 */ 2600 2626 public function field_adcmdr_enable_ga_tracking() { 2601 2627 $id = array( $this->sf()->key( 'tracking' ) => 'enable_ga_tracking' ); … … 2618 2644 } 2619 2645 2620 /**2621 * Callback for settings field.2622 *2623 * @return void2624 */2646 /** 2647 * Callback for settings field. 2648 * 2649 * @return void 2650 */ 2625 2651 public function field_adcmdr_ga_tracking_ids() { 2626 2652 $id = array( $this->sf()->key( 'tracking' ) => 'ga_tracking_ids' ); … … 2631 2657 } 2632 2658 2633 /**2634 * Callback for settings field.2635 *2636 * @return void2637 */2659 /** 2660 * Callback for settings field. 2661 * 2662 * @return void 2663 */ 2638 2664 public function field_adcmdr_ga_anonymize_ip() { 2639 2665 $id = array( $this->sf()->key( 'tracking' ) => 'ga_anonymize_ip' ); … … 2642 2668 } 2643 2669 2644 /**2645 * Callback for settings field.2646 *2647 * @return void2648 */2670 /** 2671 * Callback for settings field. 2672 * 2673 * @return void 2674 */ 2649 2675 public function field_adcmdr_disable_amp_analytics() { 2650 2676 $id = array( $this->sf()->key( 'tracking' ) => 'disable_amp_analytics' ); … … 2654 2680 } 2655 2681 2656 /**2657 * Callback for settings field.2658 *2659 * @return void2660 */2682 /** 2683 * Callback for settings field. 2684 * 2685 * @return void 2686 */ 2661 2687 public function field_adcmdr_disable_amp_pixel() { 2662 2688 $id = array( $this->sf()->key( 'tracking' ) => 'disable_amp_pixel' ); … … 2670 2696 } 2671 2697 2672 /**2673 * Callback for settings field.2674 *2675 * @return void2676 */2698 /** 2699 * Callback for settings field. 2700 * 2701 * @return void 2702 */ 2677 2703 public function field_adcmdr_bots_disable_tracking() { 2678 2704 $id = array( $this->sf()->key( 'tracking' ) => 'bots_disable_tracking' ); … … 2683 2709 } 2684 2710 2685 /**2686 * Callback for settings field.2687 *2688 * @return void2689 */2711 /** 2712 * Callback for settings field. 2713 * 2714 * @return void 2715 */ 2690 2716 public function field_adcmdr_adsense_account() { 2691 2717 $pub_id = $this->sf()->get( 'adsense_account', 'adsense' ); … … 2753 2779 ?> 2754 2780 </div> 2755 <?php2756 } 2757 2758 /**2759 * Call back for settings section.2760 *2761 * @return void2762 */2781 <?php 2782 } 2783 2784 /** 2785 * Call back for settings section. 2786 * 2787 * @return void 2788 */ 2763 2789 public function settings_callback_adcmdr_amp_defaults() { 2764 2790 ?> 2765 2791 2766 2792 <p><?php esc_html_e( 'These settings can be overridden by individual ads if needed.', 'ad-commander' ); ?></p> 2767 <?php2768 } 2769 2770 /**2771 * Call back for settings section.2772 *2773 * @return void2774 */2793 <?php 2794 } 2795 2796 /** 2797 * Call back for settings section. 2798 * 2799 * @return void 2800 */ 2775 2801 public function settings_callback_adcmdr_auto_ads() { 2776 2802 } 2777 2803 2778 /**2779 * Callback for settings field.2780 *2781 * @return void2782 */2804 /** 2805 * Callback for settings field. 2806 * 2807 * @return void 2808 */ 2783 2809 public function field_adcmdr_adsense_amp_ad_mode() { 2784 2810 $id = array( $this->sf()->key( 'adsense' ) => 'adsense_amp_ad_mode' ); … … 2798 2824 } 2799 2825 2800 2801 /** 2802 * Callback for settings field. 2803 * 2804 * @return void 2805 */ 2826 /** 2827 * Callback for settings field. 2828 * 2829 * @return void 2830 */ 2806 2831 public function field_adcmdr_insert_adsense_head_code() { 2807 2832 $id = array( $this->sf()->key( 'adsense' ) => 'insert_adsense_head_code' ); … … 2815 2840 } 2816 2841 2817 /**2818 * Callback for settings field.2819 *2820 * @return void2821 */2842 /** 2843 * Callback for settings field. 2844 * 2845 * @return void 2846 */ 2822 2847 public function field_adcmdr_enable_amp_auto_ads() { 2823 2848 $id = array( $this->sf()->key( 'adsense' ) => 'enable_amp_auto_ads' ); … … 2836 2861 } 2837 2862 2838 /**2839 * Callback for settings field.2840 *2841 * @return void2842 */2863 /** 2864 * Callback for settings field. 2865 * 2866 * @return void 2867 */ 2843 2868 public function field_adcmdr_disable_adsense_account_alerts() { 2844 2869 $pub_id = $this->sf()->get( 'adsense_account', 'adsense' ); … … 2851 2876 } 2852 2877 2853 2854 /** 2855 * Callback for settings field. 2856 * 2857 * @return void 2858 */ 2878 /** 2879 * Callback for settings field. 2880 * 2881 * @return void 2882 */ 2859 2883 public function field_adcmdr_consent_required() { 2860 2884 $id = array( $this->sf()->key( 'privacy' ) => 'consent_required' ); … … 2870 2894 } 2871 2895 2872 /**2873 * Callback for settings field.2874 *2875 * @return void2876 */2896 /** 2897 * Callback for settings field. 2898 * 2899 * @return void 2900 */ 2877 2901 public function field_adcmdr_consent_cookie_name() { 2878 2902 $id = array( $this->sf()->key( 'privacy' ) => 'consent_cookie_name' ); … … 2883 2907 } 2884 2908 2885 /**2886 * Callback for settings field.2887 *2888 * @return void2889 */2909 /** 2910 * Callback for settings field. 2911 * 2912 * @return void 2913 */ 2890 2914 public function field_adcmdr_consent_cookie_value() { 2891 2915 $id = array( $this->sf()->key( 'privacy' ) => 'consent_cookie_value' ); … … 2896 2920 } 2897 2921 2898 /**2899 * Callback for settings field.2900 *2901 * @return void2902 */2922 /** 2923 * Callback for settings field. 2924 * 2925 * @return void 2926 */ 2903 2927 public function field_adcmdr_consent_cookie_comparison() { 2904 2928 $options = array( … … 2921 2945 } 2922 2946 2923 /**2924 * Create classes for use on a meta item.2925 *2926 * @param array $suffixes An array of suffices to append.2927 *2928 * @return string2929 */2947 /** 2948 * Create classes for use on a meta item. 2949 * 2950 * @param array $suffixes An array of suffices to append. 2951 * 2952 * @return string 2953 */ 2930 2954 public static function metaitem_classes( $suffixes = array() ) { 2931 2955 $classes = array( 'adcmdr-metaitem' ); … … 2944 2968 } 2945 2969 2946 /**2947 * Interfaces with WOMeta message and adds classes.2948 *2949 * @param string $message The message to display.2950 * @param array $classes Any additional classes.2951 * @param array $args Additional arguments.2952 *2953 * @return string2954 */2970 /** 2971 * Interfaces with WOMeta message and adds classes. 2972 * 2973 * @param string $message The message to display. 2974 * @param array $classes Any additional classes. 2975 * @param array $args Additional arguments. 2976 * 2977 * @return string 2978 */ 2955 2979 protected function info( $message, $classes = array(), $args = array() ) { 2956 2980 $classes = Util::arrayify( $classes ); … … 2964 2988 } 2965 2989 2966 /**2967 * Display an add-on table.2968 *2969 * @return string2970 */2990 /** 2991 * Display an add-on table. 2992 * 2993 * @return string 2994 */ 2971 2995 protected function get_addons() { 2972 2996 $html = ''; … … 2993 3017 $html .= $this->start_div( Util::ns( 'addons' ), array( 'display' => false ) ) . 2994 3018 $this->start_div( array( Util::ns( 'addon-features' ), Util::ns( 'pro-features' ) ), array( 'display' => false ) ) . 2995 Html::h3( AdCommander::title() . ' Pro' ) .2996 Html::ul( $lis, Util::ns( 'addon' ) ) .2997 $this->start_div( 'adcmdr-btn-group', array( 'display' => false ) ) .2998 Html::abtn( self::pro_upgrade_url( array( 'utm_medium' => 'button' ) ), __( 'Upgrade to Pro', 'ad-commander' ) ) .2999 Html::abtn( AdCommander::public_site_url( '', array( 'utm_medium' => 'button' ) ), 'Learn more', '_blank', true ) .3000 $this->end_div( array( 'display' => false ) ) .3019 Html::h3( AdCommander::title() . ' Pro' ) . 3020 Html::ul( $lis, Util::ns( 'addon' ) ) . 3021 $this->start_div( 'adcmdr-btn-group', array( 'display' => false ) ) . 3022 Html::abtn( self::pro_upgrade_url( array( 'utm_medium' => 'button' ) ), __( 'Upgrade to Pro', 'ad-commander' ) ) . 3023 Html::abtn( AdCommander::public_site_url( '', array( 'utm_medium' => 'button' ) ), 'Learn more', '_blank', true ) . 3024 $this->end_div( array( 'display' => false ) ) . 3001 3025 $this->end_div( array( 'display' => false ) ) . 3002 3026 $this->end_div( array( 'display' => false ) ); … … 3019 3043 $html .= $this->start_div( Util::ns( 'addons' ), array( 'display' => false ) ) . 3020 3044 $this->start_div( Util::ns( 'addon-features' ), array( 'display' => false ) ) . 3021 Html::h3( __( 'Ad Commander Tools', 'ad-commander' ) ) .3022 Html::ul( $lis, Util::ns( 'addon' ) ) .3023 $this->start_div( 'adcmdr-btn-group', array( 'display' => false ) ) .3024 Html::abtn( AddonBridge::addon_url( 'tools' ), __( 'Download Add-on', 'ad-commander' ) ) .3025 $this->end_div( array( 'display' => false ) ) .3045 Html::h3( __( 'Ad Commander Tools', 'ad-commander' ) ) . 3046 Html::ul( $lis, Util::ns( 'addon' ) ) . 3047 $this->start_div( 'adcmdr-btn-group', array( 'display' => false ) ) . 3048 Html::abtn( AddonBridge::addon_url( 'tools' ), __( 'Download Add-on', 'ad-commander' ) ) . 3049 $this->end_div( array( 'display' => false ) ) . 3026 3050 $this->end_div( array( 'display' => false ) ) . 3027 3051 $this->end_div( array( 'display' => false ) ); … … 3035 3059 $html .= $this->start_div( Util::ns( 'addons' ), array( 'display' => false ) ) . 3036 3060 $this->start_div( Util::ns( 'addon-features' ), array( 'display' => false ) ) . 3037 Html::h3( __( 'Screen Stay Awake', 'ad-commander' ) ) .3038 Html::p( $p ) .3039 $this->start_div( 'adcmdr-btn-group', array( 'display' => false ) ) .3040 Html::abtn( AddonBridge::addon_url( 'scrnsa' ), __( 'Download Plugin', 'ad-commander' ) ) .3041 $this->end_div( array( 'display' => false ) ) .3061 Html::h3( __( 'Screen Stay Awake', 'ad-commander' ) ) . 3062 Html::p( $p ) . 3063 $this->start_div( 'adcmdr-btn-group', array( 'display' => false ) ) . 3064 Html::abtn( AddonBridge::addon_url( 'scrnsa' ), __( 'Download Plugin', 'ad-commander' ) ) . 3065 $this->end_div( array( 'display' => false ) ) . 3042 3066 $this->end_div( array( 'display' => false ) ) . 3043 3067 $this->end_div( array( 'display' => false ) ); … … 3051 3075 } 3052 3076 3053 /**3054 * Modify the ad or placement post title if it's blank.3055 *3056 * @param array $post_data The current post data.3057 *3058 * @return array3059 */3077 /** 3078 * Modify the ad or placement post title if it's blank. 3079 * 3080 * @param array $post_data The current post data. 3081 * 3082 * @return array 3083 */ 3060 3084 public function modify_post_title( $post_data ) { 3061 3085 -
ad-commander/trunk/readme.txt
r3487808 r3487830 4 4 Requires at least: 6.2 5 5 Tested up to: 6.9 6 Stable tag: 1.1.2 66 Stable tag: 1.1.27 7 7 Requires PHP: 7.4 8 8 License: GPLv3 … … 119 119 120 120 == Changelog == 121 = 1.1.27 = 122 * Add geolocation information to debugging info 123 * Hide MaxMind license from debugging info 124 121 125 = 1.1.26 = 122 126 * Add system status tab to settings
Note: See TracChangeset
for help on using the changeset viewer.