Commit inicial - WordPress Análisis de Precios Unitarios

- WordPress core y plugins
- Tema Twenty Twenty-Four configurado
- Plugin allow-unfiltered-html.php simplificado
- .gitignore configurado para excluir wp-config.php y uploads

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-11-03 21:04:30 -06:00
commit a22573bf0b
24068 changed files with 4993111 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
# Changelog
All notable changes to this project will be documented in this file.
## 1.0.0 - 21.07.2023
Initial release

View File

@@ -0,0 +1,144 @@
<?php
/**
* Temporary CSS and JS will be move to main plugin
*
* @package AdvancedAds\Framework
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.0.0
*/
namespace AdvancedAds\Framework;
// Early bail!!
if ( ! function_exists( 'add_action' ) ) {
return;
}
/**
* Register CSS
*
* @return void
*/
function advanced_ads_framework_css() {
?>
<style>
.advads-placements-table .advads-option-placement-page-peel-position div.clear {
content: ' ';
display: block;
float: none;
clear: both;
}
.advads-field-position table tbody tr td {
width: 3em !important;
height: 2em;
text-align: center;
vertical-align: middle;
padding: 0;
}
/* Switch */
.advads-field-switch input[type=checkbox] {
--active: #3e6cf4;
--active-inner: #fff;
--focus: 2px rgba(39, 94, 254, .3);
--border: #BBC1E1;
--border-hover: #3e6cf4;
--background: #fff;
--disabled: #F6F8FF;
--disabled-inner: #E1E6F9;
-webkit-appearance: none;
-moz-appearance: none;
height: 21px;
outline: none;
display: inline-block;
vertical-align: top;
position: relative;
margin: 0;
cursor: pointer;
border: 1px solid var(--bc, var(--border));
background: var(--b, var(--background));
transition: background 0.3s, border-color 0.3s, box-shadow 0.2s;
}
.advads-field-switch input[type=checkbox]:after {
content: "";
display: block;
left: 0;
top: 0;
position: absolute;
transition: transform var(--d-t, 0.3s) var(--d-t-e, ease), opacity var(--d-o, 0.2s);
}
.advads-field-switch input[type=checkbox]:checked {
--b: var(--active);
--bc: var(--active);
--d-o: .3s;
--d-t: .6s;
--d-t-e: cubic-bezier(.2, .85, .32, 1.2);
}
.advads-field-switch input[type=checkbox]:disabled {
--b: var(--disabled);
cursor: not-allowed;
opacity: 0.9;
}
.advads-field-switch input[type=checkbox]:disabled:checked {
--b: var(--disabled-inner);
--bc: var(--border);
}
.advads-field-switch input[type=checkbox]:disabled + label {
cursor: not-allowed;
}
.advads-field-switch input[type=checkbox]:hover:not(:checked):not(:disabled) {
--bc: var(--border-hover);
}
.advads-field-switch input[type=checkbox]:focus {
box-shadow: 0 0 0 var(--focus);
}
.advads-field-switch input[type=checkbox] + label {
font-size: 14px;
line-height: 21px;
display: inline-block;
vertical-align: top;
cursor: pointer;
margin-left: 4px;
}
.advads-field-switch input[type=checkbox].switch {
width: 38px;
border-radius: 11px;
}
.advads-field-switch input[type=checkbox].switch:after {
left: 2px;
top: 2px;
border-radius: 50%;
width: 15px;
height: 15px;
background: var(--ab, var(--border));
transform: translateX(var(--x, 0));
}
.advads-field-switch input[type=checkbox].switch:checked {
--ab: var(--active-inner);
--x: 17px;
}
.advads-field-switch .switch:before {
display: none !important;
}
</style>
<?php
}
add_action( 'admin_head', __NAMESPACE__ . '\\advanced_ads_framework_css', 100, 0 );
/**
* Register JS
*
* @return void
*/
function advanced_ads_framework_js() {
?>
<script>
jQuery(document).ready(function($) {
if (undefined !== jQuery.fn.wpColorPicker) {
$('.advads-field-color .advads-field-input input').wpColorPicker({defaultColor: '#5d5d5d'});
}
});
</script>
<?php
}
add_action( 'admin_footer', __NAMESPACE__ . '\\advanced_ads_framework_js', 100, 0 );

View File

@@ -0,0 +1,182 @@
<?php
/**
* Assets registry handles the registration of stylesheets and scripts required for plugin functionality.
*
* @package AdvancedAds\Framework
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.0.0
*/
namespace AdvancedAds\Framework;
use AdvancedAds\Framework\Interfaces\Integration_Interface;
defined( 'ABSPATH' ) || exit;
/**
* Assets Registry.
*
* Script functions:
*
* @method void enqueue_script(string $handle)
* @method void dequeue_script(string $handle)
* @method void deregister_script(string $handle)
* @method bool register_script(string $handle, string|false $src, string[] $deps = [], string|bool|null $ver = false, array|bool $args = [])
* @method bool inline_script(string $handle, string $data, string $position = 'after')
* @method bool is_script(string $handle, string $status = 'enqueued')
*
* Style functions:
*
* @method void enqueue_style(string $handle)
* @method void dequeue_style(string $handle)
* @method void deregister_style(string $handle)
* @method bool register_style(string $handle, string|false $src, string[] $deps = [], string|bool|null $ver = false, string $media = 'all')
* @method bool inline_style(string $handle, string $data, )
* @method bool is_style(string $handle, string $status = 'enqueued')
*/
abstract class Assets_Registry implements Integration_Interface {
/**
* Base URL for plugin local assets.
*
* @return string
*/
abstract public function get_base_url(): string;
/**
* Prefix to use in handle to make it unique.
*
* @return string
*/
abstract public function get_prefix(): string;
/**
* Version for plugin local assets.
*
* @return string
*/
abstract public function get_version(): string;
/**
* Magic method to catch all calls to.
*
* @param string $name The name of the method.
* @param array $arguments The arguments passed to the method.
*
* @return mixed
*/
public function __call( $name, $arguments ) {
if ( preg_match( '/^(enqueue|dequeue|register|deregister|is|inline)_(script|style)$/', $name, $matches ) ) {
$action = $matches[1];
$type = $matches[2];
$handle = $this->prefix_it( $arguments[0] );
$func = $this->resolve_function( $action . '_' . $type );
$func_args = [ $handle ];
switch ( $action ) {
case 'register':
$func_args[] = $this->resolve_url( $arguments[1] );
$func_args[] = $arguments[2] ?? [];
$func_args[] = isset( $arguments[3] ) && ! empty( $arguments[3] ) ? $arguments[3] : $this->get_version();
$func_args[] = $arguments[4] ?? ( 'script' === $type ? true : 'all' );
break;
case 'is':
$func_args[] = $arguments[1] ?? 'enqueued';
break;
case 'inline':
$func_args[] = $arguments[1] ?? '';
if ( 'script' === $type ) {
$func_args[] = $arguments[2] ?? 'after';
}
break;
default:
break;
}
return call_user_func_array( $func, $func_args );
}
}
/**
* Hook into WordPress.
*
* @return void
*/
public function hooks(): void {
add_action( 'wp_enqueue_scripts', [ $this, 'register_assets' ], 0 );
add_action( 'admin_enqueue_scripts', [ $this, 'register_assets' ], 0 );
}
/**
* Register assets
*
* @return void
*/
public function register_assets(): void {
$this->register_styles();
$this->register_scripts();
}
/**
* Prefix the handle
*
* @param string $handle Name of the asset.
*
* @return string
*/
public function prefix_it( $handle ): string {
return $this->get_prefix() . '-' . $handle;
}
/**
* Register styles
*
* @return void
*/
public function register_styles(): void {}
/**
* Register scripts
*
* @return void
*/
public function register_scripts(): void {}
/**
* Resolves the URL.
*
* If the provided URL is an absolute URL or protocol-relative URL, it is returned as is.
* Otherwise, the base URL is prepended to the relative path.
*
* @param string $src The source URL.
*
* @return string The resolved URL.
*/
private function resolve_url( $src ): string {
if ( preg_match( '/^(https?:)?\/\//', $src ) ) {
return $src;
}
return $this->get_base_url() . $src;
}
/**
* Resolves the function name.
*
* @param string $name The name of the function.
*
* @return string
*/
private function resolve_function( $name ): string {
$method_map = [
'is_script' => 'script_is',
'is_style' => 'style_is',
'inline_script' => 'add_inline_script',
'inline_style' => 'add_inline_style',
];
$name = $method_map[ $name ] ?? $name;
return 'wp_' . $name;
}
}

View File

@@ -0,0 +1,253 @@
<?php
/**
* JSON manger class
*
* It handles json output for use on backend and frontend.
*
* @package AdvancedAds\Framework
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.0.0
*/
namespace AdvancedAds\Framework;
use InvalidArgumentException;
defined( 'ABSPATH' ) || exit;
/**
* JSON class
*/
class JSON {
/**
* JSON Holder.
*
* @var array
*/
private $data = [];
/**
* Default Object name.
*
* @var string
*/
private $default_object_name = null;
/**
* The constructor
*
* @param string $object_name Object name to be used.
*/
public function __construct( $object_name ) {
$this->default_object_name = $object_name;
}
/**
* Bind all hooks.
*
* @since 1.0.0
*
* @throws InvalidArgumentException When object name not defined.
*
* @return void
*/
public function hooks(): void {
if ( empty( $this->default_object_name ) ) {
throw new InvalidArgumentException( 'Please set default object name to be used when printing JSON.' );
}
$hook = is_admin() ? 'admin_footer' : 'wp_footer';
add_action( $hook, [ $this, 'output' ], 0 );
}
/**
* Add to JSON object.
*
* @since 1.0.0
*
* @param mixed ...$args Arguments.
*
* Parameters can be
* 1. array|string Unique identifier or array<key, value>.
* 2. array|string The data itself can be either a scalar or an array.
* In Case of first param an array this can be object_name.
* 3. string Name for the JavaScript object.
* Passed directly, so it should be qualified JS variable.
*
* @return JSON
*/
public function add( ...$args ): JSON {
list( $key, $value, $object_name ) = $this->get_add_data( $args );
// Early Bail!!
if ( empty( $key ) ) {
return $this;
}
// If array is passed.
if ( is_array( $key ) ) {
foreach ( $key as $arr_key => $arr_value ) {
$this->add_to_storage( $arr_key, $arr_value, $object_name );
}
return $this;
}
$this->add_to_storage( $key, $value, $object_name );
return $this;
}
/**
* Add to storage.
*
* @since 1.0.0
*
* @param string $key Unique identifier.
* @param mixed $value The data itself can be either a single or an array.
* @param string $object_name Name for the JavaScript object.
* Passed directly, so it should be qualified JS variable.
* @return void
*/
private function add_to_storage( $key, $value, $object_name ): void {
// If key doesn't exists.
if ( ! isset( $this->data[ $object_name ][ $key ] ) ) {
$this->data[ $object_name ][ $key ] = $value;
return;
}
// If key already exists.
$old_value = $this->data[ $object_name ][ $key ];
$is_array = is_array( $old_value ) && is_array( $value );
$this->data[ $object_name ][ $key ] = $is_array ? array_merge( $old_value, $value ) : $value;
}
/**
* Remove from JSON object.
*
* @since 1.0.0
*
* @param string $key Unique identifier.
* @param string $object_name Name for the JavaScript object.
* Passed directly, so it should be qualified JS variable.
* @return JSON
*/
public function remove( $key, $object_name = false ): JSON {
// Early Bail!!
if ( empty( $key ) ) {
return $this;
}
if ( empty( $object_name ) ) {
$object_name = $this->default_object_name;
}
if ( isset( $this->data[ $object_name ][ $key ] ) ) {
unset( $this->data[ $object_name ][ $key ] );
}
return $this;
}
/**
* Clear all data.
*
* @since 1.0.0
*
* @return JSON
*/
public function clear_all(): JSON {
$this->data = [];
$this->data[ $this->default_object_name ] = [];
return $this;
}
/**
* Print data.
*
* @since 1.0.0
*
* @return void
*/
public function output(): void {
$script = $this->encode();
if ( ! $script ) {
return;
}
echo "<script type='text/javascript'>\n"; // CDATA and type='text/javascript' is not needed for HTML 5.
echo "/* <![CDATA[ */\n";
echo "$script\n"; // phpcs:ignore
echo "/* ]]> */\n";
echo "</script>\n";
}
/**
* Get encoded string.
*
* @since 1.0.0
*
* @return string
*/
private function encode(): string {
$script = '';
foreach ( $this->data as $object_name => $object_data ) {
$script .= $this->single_object( $object_name, $object_data );
}
return $script;
}
/**
* Encode single object.
*
* @since 1.0.0
*
* @param string $object_name Object name to use as JS variable.
* @param array $object_data Object data to json encode.
*
* @return string
*/
private function single_object( $object_name, $object_data ): string {
if ( empty( $object_data ) ) {
return '';
}
foreach ( (array) $object_data as $key => $value ) {
if ( ! is_scalar( $value ) ) {
continue;
}
$object_data[ $key ] = html_entity_decode( (string) $value, ENT_QUOTES, 'UTF-8' );
}
return "var $object_name = " . wp_json_encode( $object_data ) . ';' . PHP_EOL;
}
/**
* Normalize add arguments
*
* @param array $args Arguments array.
*
* @return array
*/
private function get_add_data( $args ): array {
$key = $args[0] ?? false;
$value = $args[1] ?? false;
$object_name = $args[2] ?? $this->default_object_name;
if ( is_array( $key ) && ! empty( $value ) ) {
$object_name = $value;
$value = false;
}
return [
$key,
$value,
$object_name,
];
}
}

View File

@@ -0,0 +1,228 @@
<?php
/**
* Class that manages loading integrations.
*
* @package AdvancedAds\Framework
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.0.0
*/
namespace AdvancedAds\Framework;
use ReflectionClass;
defined( 'ABSPATH' ) || exit;
/**
* Loader class
*/
class Loader {
/**
* The registered integrations.
*
* @var string[]
*/
protected $integrations = [];
/**
* The registered integrations.
*
* @var string[]
*/
protected $initializers = [];
/**
* The registered routes.
*
* @var string[]
*/
protected $routes = [];
/**
* Hold containers
*
* @var array
*/
protected $containers = [];
/**
* Override magic method
*
* @param string $name Name of property.
*
* @return mixed
*/
public function __get( $name ) {
if ( array_key_exists( $name, $this->containers ) ) {
return $this->containers[ $name ];
}
// phpcs:disable
$trace = debug_backtrace();
trigger_error(
'Undefined property via __get(): ' . $name .
' in ' . $trace[0]['file'] .
' on line ' . $trace[0]['line'],
E_USER_NOTICE
);
// phpcs:enable
return null;
}
/**
* Loads all registered classes if their conditionals are met.
*
* @return void
*/
public function load() {
$this->load_initializers();
if ( ! \did_action( 'init' ) ) {
\add_action( 'init', [ $this, 'load_integrations' ] );
} else {
$this->load_integrations();
}
\add_action( 'rest_api_init', [ $this, 'load_routes' ] );
}
/**
* Register as.
*
* @param string $register_as Register the container as.
* @param string $class_name The class name of the registery to be loaded.
* @param string $alias The class alias.
* @param array $args The constructor arguments.
*
* @return void
*/
private function register( $register_as, $class_name, $alias = '', $args = null ) {
if ( ! empty( $args ) ) {
$class_name = [ $class_name, $args ];
}
if ( '' === $alias ) {
$this->{$register_as}[] = $class_name;
} else {
$this->{$register_as}[ $alias ] = $class_name;
}
}
/**
* Register an integration.
*
* @param string $integration The class name of the integration to be loaded.
* @param string $alias The class alias.
* @param array $args The constructor arguments.
*
* @return void
*/
public function register_integration( $integration, $alias = '', $args = null ) {
$this->register( 'integrations', $integration, $alias, $args );
}
/**
* Register an initializer.
*
* @param string $initializer The class name of the initializer to be loaded.
* @param string $alias The class alias.
* @param array $args The constructor arguments.
*
* @return void
*/
public function register_initializer( $initializer, $alias = '', $args = null ) {
$this->register( 'initializers', $initializer, $alias, $args );
}
/**
* Register a route.
*
* @param string $router The class name of the route to be loaded.
* @param string $alias The class alias.
* @param array $args The constructor arguments.
*
* @return void
*/
public function register_route( $router, $alias = '', $args = null ) {
$this->register( 'routes', $router, $alias, $args );
}
/**
* Loads all registered initializers if their conditionals are met.
*
* @return void
*/
protected function load_initializers() {
foreach ( $this->initializers as $alias => $class ) {
$this->create_container( $class, 'initialize', $alias );
}
}
/**
* Loads all registered integrations if their conditionals are met.
*
* @return void
*/
public function load_integrations() {
foreach ( $this->integrations as $alias => $class ) {
$this->create_container( $class, 'hooks', $alias );
}
}
/**
* Loads all registered routes if their conditionals are met.
*
* @return void
*/
public function load_routes() {
foreach ( $this->routes as $alias => $class ) {
$this->create_container( $class, 'register_routes', $alias );
}
}
/**
* Create container if needed.
*
* @param string $data Class data.
* @param string $method Method to execute.
* @param string $alias Class alias.
*
* @return void
*/
private function create_container( $data, $method, $alias ): void {
$class_name = is_string( $data ) ? $data : $data[0];
$arguments = is_string( $data ) ? [] : $data[1];
if ( ! \class_exists( $class_name, true ) ) {
return;
}
$container = new ReflectionClass( $class_name );
$container = $container->newInstanceArgs( $arguments );
if ( null === $container ) {
return;
}
$container->$method();
if ( is_string( $alias ) ) {
$this->containers[ $alias ] = $container;
}
}
/**
* Define constant if not already set.
*
* @param string $name Constant name.
* @param bool|string $value Constant value.
*
* @return void
*/
protected function define( $name, $value ): void {
if ( ! defined( $name ) ) {
define( $name, $value );
}
}
}

View File

@@ -0,0 +1,150 @@
<?php
/**
* Update manger class
*
* @package AdvancedAds\Framework
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.0.0
*/
namespace AdvancedAds\Framework;
use InvalidArgumentException;
defined( 'ABSPATH' ) || exit;
/**
* Updates class
*/
abstract class Updates {
/**
* Get updates that need to run.
*
* @since 1.0.0
*
* @return array
*/
abstract public function get_updates(): array;
/**
* Get folder path
*
* @since 1.0.0
*
* @return string
*/
abstract public function get_folder(): string;
/**
* Get plugin version number
*
* @since 1.0.0
*
* @return string
*/
abstract public function get_version(): string;
/**
* Get plugin option name.
*
* @since 1.0.0
*
* @return string
*/
abstract public function get_option_name(): string;
/**
* Bind all hooks.
*
* @since 1.0.0
*
* @throws InvalidArgumentException When folder not defined.
* @throws InvalidArgumentException When version not defined.
* @throws InvalidArgumentException When option name not defined.
*
* @return void
*/
public function hooks(): void {
if ( empty( $this->get_folder() ) ) {
throw new InvalidArgumentException( 'Please set the folder path for update files.' );
}
if ( empty( $this->get_version() ) ) {
throw new InvalidArgumentException( 'Please set the plugin version number.' );
}
if ( empty( $this->get_option_name() ) ) {
throw new InvalidArgumentException( 'Please set option name to save version in database.' );
}
add_action( 'admin_init', [ $this, 'do_updates' ] );
}
/**
* Get installed version number
*
* @since 1.0.0
*
* @return string
*/
public function get_installed_version(): string {
return get_option( $this->get_option_name(), '0' );
}
/**
* Check if need any update
*
* @since 1.0.0
*/
public function do_updates() {
if ( ! current_user_can( 'update_plugins' ) ) {
return;
}
$installed_version = $this->get_installed_version();
// Maybe it's the first install.
if ( ! $installed_version ) {
$this->save_version();
return false;
}
if ( version_compare( $installed_version, $this->get_version(), '<' ) ) {
$this->perform_updates();
}
}
/**
* Perform all updates
*
* @since 1.0.0
*/
public function perform_updates() {
$installed_version = $this->get_installed_version();
foreach ( $this->get_updates() as $version => $path ) {
if ( version_compare( $installed_version, $version, '<' ) ) {
require_once $this->get_folder() . $path;
$this->save_version( $version );
}
}
$this->save_version();
}
/**
* Save version info.
*
* @since 1.0.0
*
* @param string $version Version number to save.
*/
private function save_version( $version = false ) {
if ( empty( $version ) ) {
$version = $this->get_version();
}
update_option( $this->get_option_name(), $this->get_version() );
}
}

View File

@@ -0,0 +1,41 @@
<?php
/**
* Form checkbox input
*
* @package AdvancedAds\Framework\Form
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.0.0
*/
namespace AdvancedAds\Framework\Form;
defined( 'ABSPATH' ) || exit;
/**
* Field checkbox class
*/
class Field_Checkbox extends Field {
/**
* Render field
*
* @return void
*/
public function render() {
// Early bail!!
if ( ! $this->get( 'options' ) ) {
return;
}
echo '<div class="advads-checkbox-list ' . sanitize_html_class( $this->get( 'class' ) ) . '">';
foreach ( $this->get( 'options' ) as $key => $label ) :
?>
<label>
<input type="checkbox" name="<?php echo esc_attr( $this->get( 'name' ) ); ?>[]" value="<?php echo esc_attr( $key ); ?>"<?php checked( $this->get( 'value' ), $key ); ?> /><?php echo esc_html( $label ); ?>
</label>
<?php
endforeach;
echo '</div>';
}
}

View File

@@ -0,0 +1,31 @@
<?php
/**
* Form color input
*
* @package AdvancedAds\Framework\Form
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.0.0
*/
namespace AdvancedAds\Framework\Form;
defined( 'ABSPATH' ) || exit;
/**
* Field color class
*/
class Field_Color extends Field {
/**
* Render field
*
* @return void
*/
public function render() {
wp_enqueue_style( 'wp-color-picker' );
wp_enqueue_script( 'wp-color-picker' );
?>
<input class="<?php echo sanitize_html_class( $this->get( 'class' ) ); ?>" name="<?php echo esc_attr( $this->get( 'name' ) ); ?>" type="text" value="<?php echo esc_attr( $this->get( 'value' ) ); ?>" />
<?php
}
}

View File

@@ -0,0 +1,45 @@
<?php
/**
* Form position input
*
* @package AdvancedAds\Framework\Form
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.0.0
*/
namespace AdvancedAds\Framework\Form;
defined( 'ABSPATH' ) || exit;
/**
* Field position class
*/
class Field_Position extends Field {
/**
* Render field
*
* @return void
*/
public function render() {
?>
<table class="<?php echo sanitize_html_class( $this->get( 'class' ) ); ?>">
<?php foreach ( [ 'top', 'center', 'bottom' ] as $parent ) : ?>
<tr>
<?php
foreach ( [ 'left', 'center', 'right' ] as $child ) :
$key = $parent . $child;
if ( 'centercenter' === $key ) {
$key = $child;
}
?>
<td>
<input type="radio" name="<?php echo esc_attr( $this->get( 'name' ) ); ?>" value="<?php echo esc_attr( $key ); ?>"<?php checked( $key, $this->get( 'value' ) ); ?><?php disabled( in_array( $key, $this->get( 'disabled', [] ), true ) ); ?> />
</td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</table>
<?php
}
}

View File

@@ -0,0 +1,41 @@
<?php
/**
* Form radio input
*
* @package AdvancedAds\Framework\Form
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.0.0
*/
namespace AdvancedAds\Framework\Form;
defined( 'ABSPATH' ) || exit;
/**
* Field radio class
*/
class Field_Radio extends Field {
/**
* Render field
*
* @return void
*/
public function render() {
// Early bail!!
if ( ! $this->get( 'options' ) ) {
return;
}
echo '<div class="advads-radio-list ' . sanitize_html_class( $this->get( 'class' ) ) . '">';
foreach ( $this->get( 'options' ) as $key => $label ) :
?>
<label>
<input type="radio" name="<?php echo esc_attr( $this->get( 'name' ) ); ?>" value="<?php echo esc_attr( $key ); ?>"<?php checked( $this->get( 'value' ), $key ); ?> /><?php echo esc_html( $label ); ?>
</label>
<?php
endforeach;
echo '</div>';
}
}

View File

@@ -0,0 +1,37 @@
<?php
/**
* Form selector input
*
* @package AdvancedAds\Framework\Form
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.0.0
*/
namespace AdvancedAds\Framework\Form;
defined( 'ABSPATH' ) || exit;
/**
* Field selector class
*/
class Field_Selector extends Field {
/**
* Render field
*
* @return void
*/
public function render() {
?>
<div id="advads-frontend-element-<?php echo esc_attr( $this->get( 'placement_id' ) ); ?>">
<input type="text" class="advads-frontend-element" name="<?php echo esc_attr( $this->get( 'name' ) ); ?>" value="<?php echo esc_attr( $this->get( 'value' ) ); ?>" />
<button style="display:none; color: red;" type="button" class="advads-deactivate-frontend-picker button">
stop selection
</button>
<button type="button" class="advads-activate-frontend-picker button" data-placementid="<?php echo esc_attr( $this->get( 'placement_id' ) ); ?>" data-action="edit-placement">
select position
</button>
</div>
<?php
}
}

View File

@@ -0,0 +1,41 @@
<?php
/**
* Form size input
*
* @package AdvancedAds\Framework\Form
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.0.0
*/
namespace AdvancedAds\Framework\Form;
defined( 'ABSPATH' ) || exit;
/**
* Field size class
*/
class Field_Size extends Field {
/**
* Render field
*
* @return void
*/
public function render() {
$name = $this->get( 'name' );
$value = $this->get( 'value' );
?>
<p class="<?php echo sanitize_html_class( $this->get( 'class' ) ); ?>">
<?php if ( $name['width'] ) : ?>
<label><?php esc_html_e( 'Width', 'advanced-ads-framework' ); ?>
<input type="number" value="<?php echo esc_attr( $value['width'] ); ?>" name="<?php echo esc_attr( $name['width'] ); ?>"> px</label>&nbsp;
<?php endif; ?>
<?php if ( $name['height'] ) : ?>
<label><?php esc_html_e( 'Height', 'advanced-ads-framework' ); ?>
<input type="number" value="<?php echo esc_attr( $value['height'] ); ?>" name="<?php echo esc_attr( $name['height'] ); ?>"> px</label>
<?php endif; ?>
</p>
<?php
}
}

View File

@@ -0,0 +1,30 @@
<?php
/**
* Form switch input
*
* @package AdvancedAds\Framework\Form
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.0.0
*/
namespace AdvancedAds\Framework\Form;
defined( 'ABSPATH' ) || exit;
/**
* Field switch class
*/
class Field_Switch extends Field {
/**
* Render field
*
* @return void
*/
public function render() {
?>
<input class="switch" type="checkbox" name="<?php echo esc_attr( $this->get( 'name' ) ); ?>" value="1"<?php checked( $this->get( 'value' ), '1' ); ?> />
<label for="<?php echo esc_attr( $this->get( 'id' ) ); ?>"><?php echo esc_attr( $this->get( 'switch_label' ) ); ?></label>
<?php
}
}

View File

@@ -0,0 +1,29 @@
<?php
/**
* Form text input
*
* @package AdvancedAds\Framework\Form
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.0.0
*/
namespace AdvancedAds\Framework\Form;
defined( 'ABSPATH' ) || exit;
/**
* Field text class
*/
class Field_Text extends Field {
/**
* Render field
*
* @return void
*/
public function render() {
?>
<input class="<?php echo sanitize_html_class( $this->get( 'class' ) ); ?>" name="<?php echo esc_attr( $this->get( 'name' ) ); ?>" type="<?php echo esc_attr( $this->get( 'type' ) ); ?>" value="<?php echo esc_attr( $this->get( 'value' ) ); ?>" />
<?php
}
}

View File

@@ -0,0 +1,31 @@
<?php
/**
* Form textarea input
*
* @package AdvancedAds\Framework\Form
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.0.0
*/
namespace AdvancedAds\Framework\Form;
defined( 'ABSPATH' ) || exit;
/**
* Field textarea class
*/
class Field_Textarea extends Field {
/**
* Render field
*
* @return void
*/
public function render() {
?>
<textarea class="<?php echo sanitize_html_class( $this->get( 'class' ) ); ?>" name="<?php echo esc_attr( $this->get( 'name' ) ); ?>" id="<?php echo esc_attr( $this->get( 'id' ) ); ?>" cols="<?php echo esc_attr( $this->get( 'cols' ) ); ?>" rows="<?php echo esc_attr( $this->get( 'rows' ) ); ?>">
<?php echo esc_textarea( $this->get( 'value' ) ); ?>
</textarea>
<?php
}
}

View File

@@ -0,0 +1,148 @@
<?php
/**
* Form base input
*
* @package AdvancedAds\Framework\Form
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.0.0
*/
namespace AdvancedAds\Framework\Form;
use AdvancedAds\Admin\Upgrades;
use AdvancedAds\Framework\Utilities\Str;
defined( 'ABSPATH' ) || exit;
/**
* Field class
*/
abstract class Field {
/**
* Hold field data.
*
* @var array
*/
protected $field = null;
/**
* The constructor
*
* @param array $field Field data.
*/
public function __construct( $field ) {
$defaults = [
'label' => '',
'placeholder' => '',
'class' => '',
'style' => '',
'wrapper_class' => '',
'value' => '',
'name' => $field['name'] ?? $field['id'],
'type' => 'text',
'desc' => '',
'is_pro_pitch' => false,
'cols' => 30,
'rows' => 10,
];
$this->field = wp_parse_args( $field, $defaults );
}
/**
* Get from field data by id.
*
* @param string $id Id of the data to get.
* @param mixed $default Default value if not set.
*
* @return mixed
*/
public function get( $id, $default = false ) {
return $this->field[ $id ] ?? $default;
}
/**
* Render field
*
* @return void
*/
public function render_field() {
/**
* This filter allows to extend the class dynamically by add-ons
* this would allow add-ons to dynamically hide/show only attributes belonging to them, practically not used now
*/
$class = apply_filters( 'advanced-ads-option-class', $this->get( 'id' ) );
$classnames = Str::classnames(
'advads-option',
'advads-field',
'advads-field-' . sanitize_html_class( $this->get( 'type' ) ),
'advads-option-' . sanitize_html_class( $class ),
sanitize_html_class( $this->get( 'wrapper_class' ) )
);
$this->wrap_before();
?>
<div id="<?php echo esc_attr( $this->get( 'id' ) ); ?>" class="<?php echo $classnames; // phpcs:ignore ?>">
<span class="advads-field-label"><?php echo esc_html( $this->get( 'label' ) ); ?></span>
<div class="advads-field-input">
<?php
$this->render_callback( 'before' );
$this->render();
$this->render_callback( 'after' );
if ( $this->get( 'desc' ) ) {
echo '<p class="description">' . wp_kses_post( $this->get( 'desc' ) ) . '</p>';
}
// Place an upgrade link below the description if there is one.
if ( $this->get( 'is_pro_pitch' ) ) {
Upgrades::upgrade_link( 'upgrade-pro-' . $this->get( 'id' ) );
}
?>
</div>
</div>
<?php
$this->wrap_after();
}
/**
* HTML before wrap
*
* @return void
*/
public function wrap_before() {}
/**
* HTML after wrap
*
* @return void
*/
public function wrap_after() {}
/**
* Render
*
* @return void
*/
abstract public function render();
/**
* Render callback
*
* @param string $name Id of callback.
*
* @return void
*/
private function render_callback( $name ): void {
$callback = $this->get( $name );
// Early bail!!
if ( ! $callback || ! is_callable( $callback ) ) {
return;
}
call_user_func( $callback, $this );
}
}

View File

@@ -0,0 +1,107 @@
<?php
/**
* Form rendering utility functions
*
* @package AdvancedAds\Framework\Form
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.0.0
*/
namespace AdvancedAds\Framework\Form;
use Exception;
defined( 'ABSPATH' ) || exit;
/**
* Form class
*/
class Form {
/**
* Hold fields.
*
* @var array
*/
private $fields = [];
/**
* Current field
*
* @var array
*/
private $field_types = [];
/**
* The constructor.
*
* @return void
*/
public function __construct() {
$this->field_types = [
'checkbox' => Field_Checkbox::class,
'color' => Field_Color::class,
'number' => Field_Text::class,
'position' => Field_Position::class,
'password' => Field_Text::class,
'radio' => Field_Radio::class,
'selector' => Field_Selector::class,
'size' => Field_Size::class,
'switch' => Field_Switch::class,
'text' => Field_Text::class,
'textarea' => Field_Textarea::class,
];
}
/**
* Add field.
*
* @throws Exception If no id is define.
* @throws Exception If no type is define.
*
* @param array $args Field args.
*
* @return void
*/
public function add_field( $args ) {
// Checks.
if ( ! isset( $args['id'] ) || empty( $args['id'] ) ) {
throw new Exception( 'A field must have an id.' );
}
if ( ! isset( $args['type'] ) || empty( $args['type'] ) ) {
throw new Exception( 'A field must have a type.' );
}
$this->fields[ $args['id'] ] = $args;
}
/**
* Remove field.
*
* @param string $id Field id to remove.
*
* @return void
*/
public function remove_field( $id ) {
if ( isset( $this->fields[ $id ] ) ) {
unset( $this->fields[ $id ] );
}
}
/**
* Render form.
*
* @return void
*/
public function render() {
foreach ( $this->fields as $field ) {
$type = $field['type'];
if ( isset( $this->field_types[ $type ] ) ) {
$class = $this->field_types[ $type ];
( new $class( $field ) )->render_field();
}
}
}
}

View File

@@ -0,0 +1,4 @@
<?php
/**
* Silence is golden.
*/

View File

@@ -0,0 +1,152 @@
<?php
/**
* Installation routine
*
* @package AdvancedAds\Installation
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.0.0
*/
namespace AdvancedAds\Framework\Installation;
use WP_Site;
use AdvancedAds\Framework\Interfaces\Initializer_Interface;
defined( 'ABSPATH' ) || exit;
/**
* Install.
*/
abstract class Install implements Initializer_Interface {
/**
* Plugin base file
*
* @var string
*/
protected $base_file = null;
/**
* Runs this initializer.
*
* @return void
*/
public function initialize(): void {
if ( null !== $this->base_file ) {
register_activation_hook( $this->base_file, [ $this, 'activation' ] );
register_deactivation_hook( $this->base_file, [ $this, 'deactivation' ] );
add_action( 'wp_initialize_site', [ $this, 'initialize_site' ] );
}
}
/**
* Activation routine.
*
* @param bool $network_wide Whether the plugin is being activated network-wide.
*
* @return void
*/
public function activation( $network_wide = false ): void {
register_uninstall_hook( $this->base_file, [ static::class, 'uninstall' ] );
if ( ! is_multisite() || ! $network_wide ) {
$this->activate();
return;
}
$this->network_activate_deactivate( 'activate' );
}
/**
* Deactivation routine.
*
* @param bool $network_wide Whether the plugin is being activated network-wide.
*
* @return void
*/
public function deactivation( $network_wide = false ): void {
if ( ! is_multisite() || ! $network_wide ) {
$this->deactivate();
return;
}
$this->network_activate_deactivate( 'deactivate' );
}
/**
* Fired when a new site is activated with a WPMU environment.
*
* @param WP_Site $site The new site's object.
*
* @return void
*/
public function initialize_site( $site ): void {
switch_to_blog( $site->blog_id );
$this->activate();
restore_current_blog();
}
/**
* Run network-wide activation/deactivation of the plugin.
*
* @param string $action Action to perform.
*
* @return void
*/
private function network_activate_deactivate( $action ): void {
global $wpdb;
$site_ids = self::get_sites();
if ( empty( $site_ids ) ) {
return;
}
foreach ( $site_ids as $site_id ) {
switch_to_blog( $site_id );
$this->$action();
restore_current_blog();
}
}
/**
* Get network sites
*
* @return array|int
*/
public static function get_sites() {
global $wpdb;
return get_sites(
[
'archived' => 0,
'spam' => 0,
'deleted' => 0,
'network_id' => $wpdb->siteid,
'fields' => 'ids',
]
);
}
/**
* Plugin activation callback.
*
* @return void
*/
abstract protected function activate(): void;
/**
* Plugin deactivation callback.
*
* @return void
*/
abstract protected function deactivate(): void;
/**
* Plugin uninstall callback.
*
* @return void
*/
abstract public static function uninstall(): void;
}

View File

@@ -0,0 +1,4 @@
<?php
/**
* Silence is golden.
*/

View File

@@ -0,0 +1,25 @@
<?php
/**
* An interface for registering initializer with WordPress.
*
* @package AdvancedAds\Framework
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.0.0
*/
namespace AdvancedAds\Framework\Interfaces;
defined( 'ABSPATH' ) || exit;
/**
* Initializer interface.
*/
interface Initializer_Interface {
/**
* Runs this initializer.
*
* @return void
*/
public function initialize(): void;
}

View File

@@ -0,0 +1,25 @@
<?php
/**
* An interface for registering integrations with WordPress.
*
* @package AdvancedAds\Framework
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.0.0
*/
namespace AdvancedAds\Framework\Interfaces;
defined( 'ABSPATH' ) || exit;
/**
* Integration interface.
*/
interface Integration_Interface {
/**
* Hook into WordPress.
*
* @return void
*/
public function hooks(): void;
}

View File

@@ -0,0 +1,25 @@
<?php
/**
* An interface for registering routes with WordPress.
*
* @package AdvancedAds\Framework
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.0.0
*/
namespace AdvancedAds\Framework\Interfaces;
defined( 'ABSPATH' ) || exit;
/**
* Routes interface.
*/
interface Routes_Interface {
/**
* Registers routes with WordPress.
*
* @return void
*/
public function register_routes(): void;
}

View File

@@ -0,0 +1,91 @@
<?php
/**
* Notification center
*
* @package AdvancedAds\Framework\Notices
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.0.0
*/
namespace AdvancedAds\Framework\Notices;
use AdvancedAds\Framework\Utilities\Params;
defined( 'ABSPATH' ) || exit;
/**
* Manager class
*/
class Manager extends Storage {
/**
* Hook into WordPress.
*
* @return void
*/
public function hooks(): void {
parent::hooks();
add_action( 'admin_footer', [ $this, 'print_javascript' ] );
add_action( 'wp_ajax_advads_framework_notice_dismissible', [ $this, 'notice_dismissible' ] );
}
/**
* Display the notices.
*
* @return void
*/
public function display(): void {
// Never display notices for network admin.
if ( function_exists( 'is_network_admin' ) && is_network_admin() ) {
return;
}
foreach ( $this->get_notices() as $notice ) {
if ( $notice->can_display() ) {
echo $notice; // phpcs:ignore
}
}
}
/**
* Print JS for dismissible.
*
* @return void
*/
public function print_javascript(): void {
?>
<script>
;(function($) {
$( '.is-dismissible' ).on( 'click', '.notice-dismiss', function() {
var notice = $( this ).parent()
$.ajax({
url: ajaxurl,
type: 'POST',
dataType: 'json',
data: {
action: 'advads_framework_notice_dismissible',
security: notice.data( 'security' ),
noticeId: notice.attr( 'id' )
}
});
});
})(jQuery);
</script>
<?php
}
/**
* Dismiss persistent notice.
*
* @return void
*/
public function notice_dismissible(): void {
$notice_id = Params::post( 'noticeId' );
check_ajax_referer( $notice_id, 'security' );
$notice = $this->remove( $notice_id );
}
}

View File

@@ -0,0 +1,258 @@
<?php
/**
* The single notice
*
* @package AdvancedAds\Framework\Notices
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.0.0
*/
namespace AdvancedAds\Framework\Notices;
use AdvancedAds\Framework\Interfaces\Integration_Interface;
use Serializable;
defined( 'ABSPATH' ) || exit;
/**
* Notice class
*/
class Notice implements Serializable {
/**
* Notice type.
*
* @var string
*/
const ERROR = 'error';
/**
* Notice type.
*
* @var string
*/
const SUCCESS = 'success';
/**
* Notice type.
*
* @var string
*/
const INFO = 'info';
/**
* Notice type.
*
* @var string
*/
const WARNING = 'warning';
/**
* Screen check.
*
* @var string
*/
const SCREEN_ANY = 'any';
/**
* Contains optional arguments:
*
* - type: The notice type, i.e. 'updated' or 'error'
* - persistent: Option name to save dismissal information in.
* - screen: Only display on plugin page or on every page.
* - classes: If you need any extra class to style.
*
* @var array Options of this notice.
*/
private $options = [];
/**
* Internal flag for whether notices has been displayed.
*
* @var bool
*/
private $displayed = false;
/**
* Notice message
*
* @var string
*/
private $message = '';
/**
* Notice id
*
* @var string
*/
public $id = '';
/**
* The notice class constructor.
*
* @param string $id Notice unique id.
* @param string $message Message string.
* @param array $options Set of options.
*/
public function __construct( $id, $message, $options = [] ) {
$this->id = $id;
$this->message = $message;
$this->options = wp_parse_args(
$options,
[
'classes' => '',
'persistent' => false,
'type' => self::SUCCESS,
'screen' => self::SCREEN_ANY,
]
);
}
/**
* Adds string (view) behavior.
*
* @return string
*/
public function __toString(): string {
return $this->render();
}
/**
* Serialize data, for PHP version < 7.4.0
*
* @return string
*/
public function serialize(): string {
return serialize( //phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.serialize_serialize
[
'id' => $this->id,
'message' => $this->message,
'options' => $this->options,
]
);
}
/**
* Return an array representing the serialized form the object. For PHP version >= 7.4.0
*
* @return array
*/
public function __serialize(): array {
return [
'id' => $this->id,
'message' => $this->message,
'options' => $this->options,
];
}
/**
* Recreate an instance of this class. For PHP version >= 7.4.0
*
* @param array $data the array returned by __serialize.
*
* @return void
*/
public function __unserialize( $data ): void {}
/**
* Unserialize string, for PHP version < 7.4.0
*
* @param string $data Data to unserialize.
*
* @return void
*/
public function unserialize( $data ): void {}
/**
* Return data from options.
*
* @param string $id ID to get option.
*
* @return mixed
*/
public function option( $id ) {
return $this->options[ $id ] ?? null;
}
/**
* Dismiss persistent notice.
*
* @since 1.0.0
*/
public function dismiss() {
$this->displayed = true;
$this->options['persistent'] = false;
}
/**
* Renders the notice as a string.
*
* @return string
*/
public function render(): string {
$attributes = [];
// Default notice classes.
$classes = [
'notice',
'notice-' . $this->option( 'type' ),
];
if ( ! empty( $this->option( 'classes' ) ) ) {
$classes[] = trim( $this->option( 'classes' ) );
}
if ( ! empty( $this->option( 'id' ) ) ) {
$attributes[] = sprintf( 'id="%s"', $this->option( 'id' ) );
}
// Maintain WordPress visualization of alerts when they are not persistent.
if ( $this->is_persistent() ) {
$classes[] = 'is-dismissible';
$attributes[] = sprintf( 'data-key="%s"', $this->option( 'persistent' ) );
$attributes[] = sprintf( 'data-security="%s"', wp_create_nonce( $this->option( 'id' ) ) );
}
$attributes[] = sprintf( 'class="%s"', join( ' ', $classes ) );
// Build the output DIV.
return '<div ' . join( ' ', $attributes ) . '>' . wpautop( $this->message ) . '</div>' . PHP_EOL;
}
/**
* Can display on current screen.
*
* @return bool
*/
public function can_display(): bool {
// Early Bail!!
if ( $this->displayed || ! function_exists( 'get_current_screen' ) ) {
return false;
}
$screen = get_current_screen();
if ( self::SCREEN_ANY === $this->option( 'screen' ) || false !== stristr( $screen->id, $this->option( 'screen' ) ) ) {
$this->displayed = true;
}
return $this->displayed;
}
/**
* Is this notice persistent.
*
* @return bool True if persistent, False if fire and forget.
*/
public function is_persistent() {
return ! empty( $this->option( 'persistent' ) );
}
/**
* Is this notice displayed.
*
* @return bool
*/
public function is_displayed() {
return $this->displayed;
}
}

View File

@@ -0,0 +1,177 @@
<?php
/**
* The notices storage
*
* @package AdvancedAds\Framework\Notices
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.0.0
*/
namespace AdvancedAds\Framework\Notices;
use AdvancedAds\Framework\Interfaces\Integration_Interface;
defined( 'ABSPATH' ) || exit;
/**
* Storage class
*/
class Storage implements Integration_Interface {
/**
* Option name.
*
* @var string
*/
private $option_name = null;
/**
* Notices.
*
* @var Notice[]
*/
private $notices = null;
/**
* The constructor
*
* @param string $option_name Option name to store notice in.
*/
public function __construct( $option_name ) {
$this->option_name = $option_name;
}
/**
* Hook into WordPress.
*
* @return void
*/
public function hooks(): void {
add_action( 'init', [ $this, 'get_from_storage' ] );
add_action( 'shutdown', [ $this, 'update_storage' ] );
}
/**
* Get notices.
*
* @return Notice[] Registered notices.
*/
public function get_notices() {
return $this->notices;
}
/**
* Get the notice by ID
*
* @param string $notice_id The ID of the notice to search for.
*
* @return null|Notice
*/
public function get_by_id( $notice_id ) {
return $this->notices[ $notice_id ] ?? null;
}
/**
* Add notice
*
* @param string $id Notice unique id.
* @param string $message Message string.
* @param array $options Set of options.
*
* @return Notice
*/
public function add( $id, $message, $options = [] ) {
$notice = $this->get_by_id( $id );
if ( ! is_null( $notice ) ) {
return $notice;
}
$this->notices[ $id ] = new Notice( $id, $message, $options );
return $this->notices[ $id ];
}
/**
* Remove the notice by ID
*
* @param string $notice_id The ID of the notice to search for.
*
* @return null|Notice
*/
public function remove( $notice_id ) {
$notice = $this->get_by_id( $notice_id );
if ( ! is_null( $notice ) ) {
$notice->dismiss();
}
return $notice;
}
/**
* Retrieve the notices from storage
*
* @return array Notice[] Notices
*/
public function get_from_storage() {
if ( null !== $this->notices ) {
return;
}
$this->notices = [];
$notices = get_option( $this->option_name );
// Check if there are any notices.
if ( empty( $notices ) ) {
return;
}
if ( is_array( $notices ) ) {
foreach ( $notices as $notice ) {
$this->notices[ $notice['id'] ] = new Notice(
$notice['id'],
$notice['message'],
$notice['options']
);
}
}
}
/**
* Save persistent or transactional notices to storage.
*
* We need to be able to retrieve these so they can be dismissed at any time during the execution.
*
* @return void
*/
public function update_storage(): void {
$notices = array_filter( $this->notices, [ $this, 'remove_notice' ] );
// No notices to store, clear storage.
if ( empty( $notices ) ) {
delete_option( $this->option_name );
return;
}
// Save the notices to the storage.
update_option( $this->option_name, $notices );
}
/**
* Remove notice after it has been displayed.
*
* @param Notice $notice Notice to remove.
*
* @return bool
*/
public function remove_notice( Notice $notice ) {
if ( ! $notice->is_displayed() ) {
return true;
}
if ( $notice->is_persistent() ) {
return true;
}
return false;
}
}

View File

@@ -0,0 +1,242 @@
<?php
/**
* Array utilities
*
* @package AdvancedAds\Framework\Utilities
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.0.0
*/
namespace AdvancedAds\Framework\Utilities;
use ArrayAccess;
defined( 'ABSPATH' ) || exit;
/**
* Arr class.
*/
class Arr {
/**
* Determine whether the given value is array accessible.
*
* @param mixed $value Value to check.
*
* @return bool
*/
public static function accessible( $value ) {
return is_array( $value ) || $value instanceof ArrayAccess;
}
/**
* Determine if the given key exists in the provided array.
*
* @param ArrayAccess|array $arr Array to check key in.
* @param string|int $key Key to check for.
*
* @return bool
*/
public static function exists( $arr, $key ) {
if ( $arr instanceof ArrayAccess ) {
return $arr->offsetExists( $key );
}
return array_key_exists( $key, $arr );
}
/**
* Get an item from an array using "dot" notation.
*
* @param \ArrayAccess|array $array Array to get from.
* @param string|int|null $key Key to get.
* @param mixed $default Default value to return if key does not exist.
*
* @return mixed
*/
public static function get( $array, $key, $default = null ) {
if ( ! static::accessible( $array ) ) {
return $default;
}
if ( null === $key ) {
return $array;
}
if ( static::exists( $array, $key ) ) {
return $array[ $key ];
}
if ( ! Str::contains( '.', $key ) ) {
return $array[ $key ] ?? $default;
}
foreach ( explode( '.', $key ) as $segment ) {
if ( static::accessible( $array ) && static::exists( $array, $segment ) ) {
$array = $array[ $segment ];
} else {
return $default;
}
}
return $array;
}
/**
* Check if an item or items exist in an array using "dot" notation.
*
* @param \ArrayAccess|array $array Array to check in.
* @param string|array $keys Key or keys to check for.
*
* @return bool
*/
public static function has( $array, $keys ): bool {
$keys = (array) $keys;
if ( ! $array || [] === $keys ) {
return false;
}
foreach ( $keys as $key ) {
$subkey_array = $array;
if ( static::exists( $array, $key ) ) {
continue;
}
foreach ( explode( '.', $key ) as $segment ) {
if ( static::accessible( $subkey_array ) && static::exists( $subkey_array, $segment ) ) {
$subkey_array = $subkey_array[ $segment ];
} else {
return false;
}
}
}
return true;
}
/**
* Determine if any of the keys exist in an array using "dot" notation.
*
* @param \ArrayAccess|array $array Array to check in.
* @param string|array $keys Key or keys to check for.
*
* @return bool
*/
public static function has_any( $array, $keys ): bool {
if ( null === $keys ) {
return false;
}
$keys = (array) $keys;
if ( ! $array ) {
return false;
}
if ( [] === $keys ) {
return false;
}
foreach ( $keys as $key ) {
if ( static::has( $array, $key ) ) {
return true;
}
}
return false;
}
/**
* Insert a single array item inside another array at a set position
*
* @param array $arr Array to modify. Is passed by reference, and no return is needed.
* @param array $new New array to insert.
* @param int $position Position in the main array to insert the new array.
*/
public static function insert( &$arr, $new, $position ) {
$before = array_slice( $arr, 0, $position - 1 );
$after = array_diff_key( $arr, $before );
$arr = array_merge( $before, $new, $after );
}
/**
* Set an array item to a given value using "dot" notation.
*
* If no key is given to the method, the entire array will be replaced.
*
* @param array $array Array to set value in.
* @param string|int|null $key Key to set.
* @param mixed $value Value to set.
*
* @return array
*/
public static function set( &$array, $key, $value ): array {
if ( null === $key ) {
$array = $value;
return $array;
}
$keys = explode( '.', $key );
foreach ( $keys as $i => $key ) {
if ( 1 === count( $keys ) ) {
break;
}
unset( $keys[ $i ] );
// If the key doesn't exist at this depth, we will just create an empty array
// to hold the next value, allowing us to create the arrays to hold final
// values at the correct depth. Then we'll keep digging into the array.
if ( ! isset( $array[ $key ] ) || ! is_array( $array[ $key ] ) ) {
$array[ $key ] = [];
}
$array = &$array[ $key ];
}
$array[ array_shift( $keys ) ] = $value;
return $array;
}
/**
* Filter the array using the given callback.
*
* @param array $array Array to filter.
* @param callable $callback Callback to use for filtering.
*
* @return array
*/
public static function where( $array, callable $callback ): array {
return array_filter( $array, $callback, ARRAY_FILTER_USE_BOTH );
}
/**
* Filter items where the value is not null.
*
* @param array $array Array to filter.
*
* @return array
*/
public static function where_not_null( $array ): array {
return static::where( $array, fn ( $value ) => null !== $value );
}
/**
* If the given value is not an array and not null, wrap it in one.
*
* @param mixed $value Value to wrap.
*
* @return array
*/
public static function wrap( $value ): array {
if ( null === $value ) {
return [];
}
return is_array( $value ) ? $value : [ $value ];
}
}

View File

@@ -0,0 +1,145 @@
<?php
/**
* Data formatting utilities
*
* @package AdvancedAds\Framework\Utilities
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.0.0
*/
namespace AdvancedAds\Framework\Utilities;
defined( 'ABSPATH' ) || exit;
/**
* Formatting class.
*/
class Formatting {
/**
* Converts a string (e.g. 'yes' or 'no') to a bool.
*
* @param string|bool $str String to convert. If a bool is passed it will be returned as-is.
*
* @return bool
*/
public static function string_to_bool( $str ): bool {
$str = $str ?? '';
return is_bool( $str ) ? $str : ( 'yes' === strtolower( $str ) || 1 === $str || 'true' === strtolower( $str ) || '1' === $str || 'on' === strtolower( $str ) );
}
/**
* Converts a bool to a 'yes' or 'no'.
*
* @param bool|string $boolval Bool to convert. If a string is passed it will first be converted to a bool.
*
* @return string
*/
public static function bool_to_string( $boolval ): string {
if ( ! is_bool( $boolval ) ) {
$boolval = self::string_to_bool( $boolval );
}
return true === $boolval ? 'yes' : 'no';
}
/**
* Explode a string into an array by $delimiter and remove empty values.
*
* @param string $str String to convert.
* @param string $delimiter Delimiter, defaults to ','.
*
* @return array
*/
public static function string_to_array( $str, $delimiter = ',' ): array {
$str = $str ?? '';
return is_array( $str ) ? $str : array_filter( explode( $delimiter, $str ) );
}
/**
* Convert a float to a string without locale formatting which PHP adds when changing floats to strings.
*
* @param float $floatval Float value to format.
*
* @return string
*/
public static function float_to_string( $floatval ): string {
if ( ! is_float( $floatval ) ) {
return $floatval;
}
$locale = localeconv();
$string = strval( $floatval );
$string = str_replace( $locale['decimal_point'], '.', $string );
return $string;
}
/**
* Clean variables using sanitize_text_field. Arrays are cleaned recursively.
* Non-scalar values are ignored.
*
* @param string|array $value Data to sanitize.
*
* @return string|array
*/
public static function clean( $value ) {
if ( is_array( $value ) ) {
return array_map( [ self::class, 'clean' ], $value );
}
return is_scalar( $value ) ? sanitize_text_field( $value ) : $value;
}
/**
* Function wp_check_invalid_utf8 with recursive array support.
*
* @param string|array $value Data to sanitize.
*
* @return string|array
*/
public static function check_invalid_utf8( $value ) {
if ( is_array( $value ) ) {
return array_map( [ self::class, 'check_invalid_utf8' ], $value );
}
return wp_check_invalid_utf8( $value );
}
/**
* Run clean over posted textarea but maintain line breaks.
*
* @param string $value Data to sanitize.
*
* @return string
*/
public static function sanitize_textarea( $value ) {
return implode( "\n", array_map( 'clean', explode( "\n", $value ?? '' ) ) );
}
/**
* Sanitize a string destined to be a tooltip.
*
* @param string $value Data to sanitize.
*
* @return string
*/
public static function sanitize_tooltip( $value ) {
return htmlspecialchars(
wp_kses(
html_entity_decode( $value ?? '' ),
[
'br' => [],
'em' => [],
'strong' => [],
'small' => [],
'span' => [],
'ul' => [],
'li' => [],
'ol' => [],
'p' => [],
]
)
);
}
}

View File

@@ -0,0 +1,103 @@
<?php
/**
* HTML formatting utilities
*
* @package AdvancedAds\Framework\Utilities
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.0.0
*/
namespace AdvancedAds\Framework\Utilities;
defined( 'ABSPATH' ) || exit;
/**
* HTML class.
*/
class HTML {
/**
* Implode and escape HTML attributes for output.
*
* @param array $raw_attributes Attribute name value pairs.
*
* @return string
*/
public static function build_attributes( $raw_attributes ) {
$attributes = [];
foreach ( $raw_attributes as $name => $value ) {
$attributes[] = esc_attr( $name ) . '="' . esc_attr( $value ) . '"';
}
return implode( ' ', $attributes );
}
/**
* Generate classnames from arguments
*
* @return string
*/
public static function classnames(): string {
$args = func_get_args();
$data = array_reduce( $args, [ __CLASS__, 'classnames_reduce' ], [] );
$classes = array_map(
[ __CLASS__, 'classnames_mapper' ],
array_keys( $data ),
array_values( $data )
);
$classes = array_filter( $classes );
return implode( ' ', $classes );
}
/**
* Classnames helper function
*
* @param mixed $carry Holds the return value of the previous iteration.
* @param mixed $item Holds the value of the current iteration.
*
* @return mixed
*/
private static function classnames_reduce( $carry, $item ) {
if ( is_array( $item ) ) {
return array_merge( $carry, $item );
}
$carry[] = $item;
return $carry;
}
/**
* Classnames helper function
*
* @param mixed $key Key of array item.
* @param mixed $value Value of array item.
*
* @return array
*/
private static function classnames_mapper( $key, $value ) {
$condition = $value;
$return = $key;
if ( is_int( $key ) ) {
$condition = null;
$return = $value;
}
$is_array = is_array( $return );
$is_object = is_object( $return );
$is_stringable_type = ! $is_array && ! $is_object;
$is_stringable_object = $is_object && method_exists( $return, '__toString' );
if ( ! $is_stringable_type && ! $is_stringable_object ) {
return null;
}
if ( null === $condition ) {
return $return;
}
return $condition ? $return : null;
}
}

View File

@@ -0,0 +1,141 @@
<?php
/**
* Params class
*
* Easy access to inputs from
* INPUT_COOKIE
* INPUT_GET
* INPUT_POST
* INPUT_REQUEST
* INPUT_ENV
* INPUT_SERVER
*
* @package AdvancedAds\Framework\Utilities
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.0.0
*/
namespace AdvancedAds\Framework\Utilities;
/**
* Params class
*/
class Params {
/**
* Get field from input.
*
* @param string $input Input to get from.
* @param string $id Field id to get.
* @param mixed $default Default value to return if field is not found.
* @param int $filter The ID of the filter to apply.
* @param int $flag The ID of the flag to apply.
*
* @return mixed
*/
private static function input( $input, $id, $default = false, $filter = FILTER_DEFAULT, $flag = [] ) {
return filter_has_var( $input, $id ) ? filter_input( $input, $id, $filter, $flag ) : $default;
}
/**
* Get field from query string.
*
* @param string $id Field id to get.
* @param mixed $default Default value to return if field is not found.
* @param int $filter The ID of the filter to apply.
* @param int $flag The ID of the flag to apply.
*
* @return mixed
*/
public static function get( $id, $default = false, $filter = FILTER_DEFAULT, $flag = [] ) {
return self::input( INPUT_GET, $id, $default, $filter, $flag );
}
/**
* Get field from FORM post.
*
* @param string $id Field id to get.
* @param mixed $default Default value to return if field is not found.
* @param int $filter The ID of the filter to apply.
* @param int $flag The ID of the flag to apply.
*
* @return mixed
*/
public static function post( $id, $default = false, $filter = FILTER_DEFAULT, $flag = [] ) {
return self::input( INPUT_POST, $id, $default, $filter, $flag );
}
/**
* Get field from FORM server.
*
* @param string $id Field id to get.
* @param mixed $default Default value to return if field is not found.
* @param int $filter The ID of the filter to apply.
* @param int $flag The ID of the flag to apply.
*
* @return mixed
*/
public static function server( $id, $default = false, $filter = FILTER_DEFAULT, $flag = [] ) {
return isset( $_SERVER[ $id ] ) ? filter_var( wp_unslash( $_SERVER[ $id ] ), $filter, $flag ) : $default;
}
/**
* Get field from FORM cookie.
*
* @param string $id Field id to get.
* @param mixed $default Default value to return if field is not found.
* @param int $filter The ID of the filter to apply.
* @param int $flag The ID of the flag to apply.
*
* @return mixed
*/
public static function cookie( $id, $default = false, $filter = FILTER_DEFAULT, $flag = [] ) {
return self::input( INPUT_COOKIE, $id, $default, $filter, $flag );
}
/**
* Get field from FORM env.
*
* @param string $id Field id to get.
* @param mixed $default Default value to return if field is not found.
* @param int $filter The ID of the filter to apply.
* @param int $flag The ID of the flag to apply.
*
* @return mixed
*/
public static function env( $id, $default = false, $filter = FILTER_DEFAULT, $flag = [] ) {
return isset( $_ENV[ $id ] ) ? filter_var( wp_unslash( $_ENV[ $id ] ), $filter, $flag ) : $default;
}
/**
* Get field from request.
*
* @param string $id Field id to get.
* @param mixed $default Default value to return if field is not found.
* @param int $filter The ID of the filter to apply.
* @param int $flag The ID of the flag to apply.
*
* @return mixed
*/
public static function request( $id, $default = false, $filter = FILTER_DEFAULT, $flag = [] ) {
$request_filters = [
'G' => INPUT_GET,
'P' => INPUT_POST,
'C' => INPUT_COOKIE,
];
// This directive describes the order in which PHP registers GET, POST and Cookie variables into the _REQUEST array. Registration is done from left to right, newer values override older values.
$request_order = ini_get( 'request_order' ) ? ini_get( 'request_order' ) : 'GP';
$request_order = str_split( $request_order );
$request_order = array_reverse( $request_order );
foreach ( $request_order as $r ) {
if ( filter_has_var( $request_filters[ $r ], $id ) ) {
// Return early if found.
return filter_input( $request_filters[ $r ], $id, $filter, $flag );
}
}
return $default;
}
}

View File

@@ -0,0 +1,146 @@
<?php
/**
* String utilities
*
* @package AdvancedAds\Framework\Utilities
* @author Advanced Ads <info@wpadvancedads.com>
* @since 1.0.0
*/
namespace AdvancedAds\Framework\Utilities;
defined( 'ABSPATH' ) || exit;
/**
* Str class.
*/
class Str {
/**
* Capitalizes a string.
*
* @param string $str The string to be capitalized.
*
* @return string The capitalized string.
*/
public static function capitalize( $str ) {
return ucwords( str_replace( '_', ' ', $str ) );
}
/**
* Check if the string contains the given value.
*
* @param string $needle The sub-string to search for.
* @param string $haystack The string to search.
* @param bool $ignore_case Whether to ignore the case.
*
* @return bool
*/
public static function contains( $needle, $haystack, $ignore_case = false ): bool {
if ( $ignore_case ) {
$haystack = self::to_lower( $haystack );
}
return '' !== $needle && mb_strpos( $haystack, $needle ) !== false
? true : false;
}
/**
* Validates whether the passed variable is a empty string.
*
* @param mixed $str The variable to validate.
*
* @return bool Whether or not the passed value is a non-empty string.
*/
public static function is_empty( $str ): bool {
return ! is_string( $str ) || empty( $str );
}
/**
* Validates whether the passed variable is a non-empty string.
*
* @param mixed $str The variable to validate.
*
* @return bool Whether or not the passed value is a non-empty string.
*/
public static function is_non_empty( $str ): bool {
return is_string( $str ) && '' !== $str;
}
/**
* Check if the string end with the given value.
*
* @param string $needle The sub-string to search for.
* @param string $haystack The string to search.
*
* @return bool
*/
public static function ends_with( $needle, $haystack ): bool {
return '' !== $needle && mb_substr( $haystack, -self::length( $needle ) ) === (string) $needle
? true : false;
}
/**
* Return the length of the given string.
*
* @param string $value The string to get the length of.
* @param string|null $encoding The encoding to use.
*
* @return int
*/
public static function length( $value, $encoding = null ): int {
if ( $encoding ) {
return mb_strlen( $value, $encoding );
}
return mb_strlen( $value );
}
/**
* Check if the string begins with the given value.
*
* @param string $needle The sub-string to search for.
* @param string $haystack The string to search.
*
* @return bool
*/
public static function starts_with( $needle, $haystack ): bool {
return '' !== $needle && mb_substr( $haystack, 0, self::length( $needle ) ) === (string) $needle
? true : false;
}
/**
* Wrapper for mb_strtoupper which see's if supported first.
*
* @param string $str String to format.
* @param string|null $encoding Encoding to use.
*
* @return string
*/
public static function to_upper( $str, $encoding = 'UTF-8' ) {
$str = $str ?? '';
if ( function_exists( 'mb_strtoupper' ) ) {
return $encoding ? mb_strtoupper( $str, $encoding ) : mb_strtoupper( $str );
}
return strtoupper( $str );
}
/**
* Make a string lowercase.
* Try to use mb_strtolower() when available.
*
* @param string $str String to format.
* @param string|null $encoding Encoding to use.
*
* @return string
*/
public static function to_lower( $str, $encoding = 'UTF-8' ) {
$str = $str ?? '';
if ( function_exists( 'mb_strtolower' ) ) {
return $encoding ? mb_strtolower( $str, $encoding ) : mb_strtolower( $str );
}
return strtolower( $str );
}
}

View File

@@ -0,0 +1,22 @@
<?php
// autoload.php @generated by Composer
if (PHP_VERSION_ID < 50600) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, $err);
} elseif (!headers_sent()) {
echo $err;
}
}
throw new RuntimeException($err);
}
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit_AdvancedAds::getLoader();

View File

@@ -0,0 +1,579 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Autoload;
/**
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
*
* $loader = new \Composer\Autoload\ClassLoader();
*
* // register classes with namespaces
* $loader->add('Symfony\Component', __DIR__.'/component');
* $loader->add('Symfony', __DIR__.'/framework');
*
* // activate the autoloader
* $loader->register();
*
* // to enable searching the include path (eg. for PEAR packages)
* $loader->setUseIncludePath(true);
*
* In this example, if you try to use a class in the Symfony\Component
* namespace or one of its children (Symfony\Component\Console for instance),
* the autoloader will first look for the class under the component/
* directory, and it will then fallback to the framework/ directory if not
* found before giving up.
*
* This class is loosely based on the Symfony UniversalClassLoader.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Jordi Boggiano <j.boggiano@seld.be>
* @see https://www.php-fig.org/psr/psr-0/
* @see https://www.php-fig.org/psr/psr-4/
*/
class ClassLoader
{
/** @var \Closure(string):void */
private static $includeFile;
/** @var string|null */
private $vendorDir;
// PSR-4
/**
* @var array<string, array<string, int>>
*/
private $prefixLengthsPsr4 = array();
/**
* @var array<string, list<string>>
*/
private $prefixDirsPsr4 = array();
/**
* @var list<string>
*/
private $fallbackDirsPsr4 = array();
// PSR-0
/**
* List of PSR-0 prefixes
*
* Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
*
* @var array<string, array<string, list<string>>>
*/
private $prefixesPsr0 = array();
/**
* @var list<string>
*/
private $fallbackDirsPsr0 = array();
/** @var bool */
private $useIncludePath = false;
/**
* @var array<string, string>
*/
private $classMap = array();
/** @var bool */
private $classMapAuthoritative = false;
/**
* @var array<string, bool>
*/
private $missingClasses = array();
/** @var string|null */
private $apcuPrefix;
/**
* @var array<string, self>
*/
private static $registeredLoaders = array();
/**
* @param string|null $vendorDir
*/
public function __construct($vendorDir = null)
{
$this->vendorDir = $vendorDir;
self::initializeIncludeClosure();
}
/**
* @return array<string, list<string>>
*/
public function getPrefixes()
{
if (!empty($this->prefixesPsr0)) {
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
}
return array();
}
/**
* @return array<string, list<string>>
*/
public function getPrefixesPsr4()
{
return $this->prefixDirsPsr4;
}
/**
* @return list<string>
*/
public function getFallbackDirs()
{
return $this->fallbackDirsPsr0;
}
/**
* @return list<string>
*/
public function getFallbackDirsPsr4()
{
return $this->fallbackDirsPsr4;
}
/**
* @return array<string, string> Array of classname => path
*/
public function getClassMap()
{
return $this->classMap;
}
/**
* @param array<string, string> $classMap Class to filename map
*
* @return void
*/
public function addClassMap(array $classMap)
{
if ($this->classMap) {
$this->classMap = array_merge($this->classMap, $classMap);
} else {
$this->classMap = $classMap;
}
}
/**
* Registers a set of PSR-0 directories for a given prefix, either
* appending or prepending to the ones previously set for this prefix.
*
* @param string $prefix The prefix
* @param list<string>|string $paths The PSR-0 root directories
* @param bool $prepend Whether to prepend the directories
*
* @return void
*/
public function add($prefix, $paths, $prepend = false)
{
$paths = (array) $paths;
if (!$prefix) {
if ($prepend) {
$this->fallbackDirsPsr0 = array_merge(
$paths,
$this->fallbackDirsPsr0
);
} else {
$this->fallbackDirsPsr0 = array_merge(
$this->fallbackDirsPsr0,
$paths
);
}
return;
}
$first = $prefix[0];
if (!isset($this->prefixesPsr0[$first][$prefix])) {
$this->prefixesPsr0[$first][$prefix] = $paths;
return;
}
if ($prepend) {
$this->prefixesPsr0[$first][$prefix] = array_merge(
$paths,
$this->prefixesPsr0[$first][$prefix]
);
} else {
$this->prefixesPsr0[$first][$prefix] = array_merge(
$this->prefixesPsr0[$first][$prefix],
$paths
);
}
}
/**
* Registers a set of PSR-4 directories for a given namespace, either
* appending or prepending to the ones previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param list<string>|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
*
* @return void
*/
public function addPsr4($prefix, $paths, $prepend = false)
{
$paths = (array) $paths;
if (!$prefix) {
// Register directories for the root namespace.
if ($prepend) {
$this->fallbackDirsPsr4 = array_merge(
$paths,
$this->fallbackDirsPsr4
);
} else {
$this->fallbackDirsPsr4 = array_merge(
$this->fallbackDirsPsr4,
$paths
);
}
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
// Register directories for a new namespace.
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = $paths;
} elseif ($prepend) {
// Prepend directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
$paths,
$this->prefixDirsPsr4[$prefix]
);
} else {
// Append directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
$this->prefixDirsPsr4[$prefix],
$paths
);
}
}
/**
* Registers a set of PSR-0 directories for a given prefix,
* replacing any others previously set for this prefix.
*
* @param string $prefix The prefix
* @param list<string>|string $paths The PSR-0 base directories
*
* @return void
*/
public function set($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr0 = (array) $paths;
} else {
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
}
}
/**
* Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param list<string>|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
*
* @return void
*/
public function setPsr4($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr4 = (array) $paths;
} else {
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
}
}
/**
* Turns on searching the include path for class files.
*
* @param bool $useIncludePath
*
* @return void
*/
public function setUseIncludePath($useIncludePath)
{
$this->useIncludePath = $useIncludePath;
}
/**
* Can be used to check if the autoloader uses the include path to check
* for classes.
*
* @return bool
*/
public function getUseIncludePath()
{
return $this->useIncludePath;
}
/**
* Turns off searching the prefix and fallback directories for classes
* that have not been registered with the class map.
*
* @param bool $classMapAuthoritative
*
* @return void
*/
public function setClassMapAuthoritative($classMapAuthoritative)
{
$this->classMapAuthoritative = $classMapAuthoritative;
}
/**
* Should class lookup fail if not found in the current class map?
*
* @return bool
*/
public function isClassMapAuthoritative()
{
return $this->classMapAuthoritative;
}
/**
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
*
* @param string|null $apcuPrefix
*
* @return void
*/
public function setApcuPrefix($apcuPrefix)
{
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
}
/**
* The APCu prefix in use, or null if APCu caching is not enabled.
*
* @return string|null
*/
public function getApcuPrefix()
{
return $this->apcuPrefix;
}
/**
* Registers this instance as an autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not
*
* @return void
*/
public function register($prepend = false)
{
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
if (null === $this->vendorDir) {
return;
}
if ($prepend) {
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
} else {
unset(self::$registeredLoaders[$this->vendorDir]);
self::$registeredLoaders[$this->vendorDir] = $this;
}
}
/**
* Unregisters this instance as an autoloader.
*
* @return void
*/
public function unregister()
{
spl_autoload_unregister(array($this, 'loadClass'));
if (null !== $this->vendorDir) {
unset(self::$registeredLoaders[$this->vendorDir]);
}
}
/**
* Loads the given class or interface.
*
* @param string $class The name of the class
* @return true|null True if loaded, null otherwise
*/
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
$includeFile = self::$includeFile;
$includeFile($file);
return true;
}
return null;
}
/**
* Finds the path to the file where the class is defined.
*
* @param string $class The name of the class
*
* @return string|false The path if found, false otherwise
*/
public function findFile($class)
{
// class map lookup
if (isset($this->classMap[$class])) {
return $this->classMap[$class];
}
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
return false;
}
if (null !== $this->apcuPrefix) {
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
if ($hit) {
return $file;
}
}
$file = $this->findFileWithExtension($class, '.php');
// Search for Hack files if we are running on HHVM
if (false === $file && defined('HHVM_VERSION')) {
$file = $this->findFileWithExtension($class, '.hh');
}
if (null !== $this->apcuPrefix) {
apcu_add($this->apcuPrefix.$class, $file);
}
if (false === $file) {
// Remember that this class does not exist.
$this->missingClasses[$class] = true;
}
return $file;
}
/**
* Returns the currently registered loaders keyed by their corresponding vendor directories.
*
* @return array<string, self>
*/
public static function getRegisteredLoaders()
{
return self::$registeredLoaders;
}
/**
* @param string $class
* @param string $ext
* @return string|false
*/
private function findFileWithExtension($class, $ext)
{
// PSR-4 lookup
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
$first = $class[0];
if (isset($this->prefixLengthsPsr4[$first])) {
$subPath = $class;
while (false !== $lastPos = strrpos($subPath, '\\')) {
$subPath = substr($subPath, 0, $lastPos);
$search = $subPath . '\\';
if (isset($this->prefixDirsPsr4[$search])) {
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
foreach ($this->prefixDirsPsr4[$search] as $dir) {
if (file_exists($file = $dir . $pathEnd)) {
return $file;
}
}
}
}
}
// PSR-4 fallback dirs
foreach ($this->fallbackDirsPsr4 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
return $file;
}
}
// PSR-0 lookup
if (false !== $pos = strrpos($class, '\\')) {
// namespaced class name
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
} else {
// PEAR-like class name
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
}
if (isset($this->prefixesPsr0[$first])) {
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
if (0 === strpos($class, $prefix)) {
foreach ($dirs as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
}
}
}
// PSR-0 fallback dirs
foreach ($this->fallbackDirsPsr0 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
// PSR-0 include paths.
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
return $file;
}
return false;
}
/**
* @return void
*/
private static function initializeIncludeClosure()
{
if (self::$includeFile !== null) {
return;
}
/**
* Scope isolated include.
*
* Prevents access to $this/self from included files.
*
* @param string $file
* @return void
*/
self::$includeFile = \Closure::bind(static function($file) {
include $file;
}, null, null);
}
}

View File

@@ -0,0 +1,396 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer;
use Composer\Autoload\ClassLoader;
use Composer\Semver\VersionParser;
/**
* This class is copied in every Composer installed project and available to all
*
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
*
* To require its presence, you can require `composer-runtime-api ^2.0`
*
* @final
*/
class InstalledVersions
{
/**
* @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to
* @internal
*/
private static $selfDir = null;
/**
* @var mixed[]|null
* @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
*/
private static $installed;
/**
* @var bool
*/
private static $installedIsLocalDir;
/**
* @var bool|null
*/
private static $canGetVendors;
/**
* @var array[]
* @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
*/
private static $installedByVendor = array();
/**
* Returns a list of all package names which are present, either by being installed, replaced or provided
*
* @return string[]
* @psalm-return list<string>
*/
public static function getInstalledPackages()
{
$packages = array();
foreach (self::getInstalled() as $installed) {
$packages[] = array_keys($installed['versions']);
}
if (1 === \count($packages)) {
return $packages[0];
}
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
}
/**
* Returns a list of all package names with a specific type e.g. 'library'
*
* @param string $type
* @return string[]
* @psalm-return list<string>
*/
public static function getInstalledPackagesByType($type)
{
$packagesByType = array();
foreach (self::getInstalled() as $installed) {
foreach ($installed['versions'] as $name => $package) {
if (isset($package['type']) && $package['type'] === $type) {
$packagesByType[] = $name;
}
}
}
return $packagesByType;
}
/**
* Checks whether the given package is installed
*
* This also returns true if the package name is provided or replaced by another package
*
* @param string $packageName
* @param bool $includeDevRequirements
* @return bool
*/
public static function isInstalled($packageName, $includeDevRequirements = true)
{
foreach (self::getInstalled() as $installed) {
if (isset($installed['versions'][$packageName])) {
return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
}
}
return false;
}
/**
* Checks whether the given package satisfies a version constraint
*
* e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
*
* Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
*
* @param VersionParser $parser Install composer/semver to have access to this class and functionality
* @param string $packageName
* @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
* @return bool
*/
public static function satisfies(VersionParser $parser, $packageName, $constraint)
{
$constraint = $parser->parseConstraints((string) $constraint);
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
return $provided->matches($constraint);
}
/**
* Returns a version constraint representing all the range(s) which are installed for a given package
*
* It is easier to use this via isInstalled() with the $constraint argument if you need to check
* whether a given version of a package is installed, and not just whether it exists
*
* @param string $packageName
* @return string Version constraint usable with composer/semver
*/
public static function getVersionRanges($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
$ranges = array();
if (isset($installed['versions'][$packageName]['pretty_version'])) {
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
}
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
}
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
}
if (array_key_exists('provided', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
}
return implode(' || ', $ranges);
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
*/
public static function getVersion($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['version'])) {
return null;
}
return $installed['versions'][$packageName]['version'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
*/
public static function getPrettyVersion($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
return null;
}
return $installed['versions'][$packageName]['pretty_version'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
*/
public static function getReference($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['reference'])) {
return null;
}
return $installed['versions'][$packageName]['reference'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
*/
public static function getInstallPath($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @return array
* @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
*/
public static function getRootPackage()
{
$installed = self::getInstalled();
return $installed[0]['root'];
}
/**
* Returns the raw installed.php data for custom implementations
*
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
* @return array[]
* @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
*/
public static function getRawData()
{
@trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
if (null === self::$installed) {
// only require the installed.php file if this file is loaded from its dumped location,
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
if (substr(__DIR__, -8, 1) !== 'C') {
self::$installed = include __DIR__ . '/installed.php';
} else {
self::$installed = array();
}
}
return self::$installed;
}
/**
* Returns the raw data of all installed.php which are currently loaded for custom implementations
*
* @return array[]
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
*/
public static function getAllRawData()
{
return self::getInstalled();
}
/**
* Lets you reload the static array from another file
*
* This is only useful for complex integrations in which a project needs to use
* this class but then also needs to execute another project's autoloader in process,
* and wants to ensure both projects have access to their version of installed.php.
*
* A typical case would be PHPUnit, where it would need to make sure it reads all
* the data it needs from this class, then call reload() with
* `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
* the project in which it runs can then also use this class safely, without
* interference between PHPUnit's dependencies and the project's dependencies.
*
* @param array[] $data A vendor/composer/installed.php data set
* @return void
*
* @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
*/
public static function reload($data)
{
self::$installed = $data;
self::$installedByVendor = array();
// when using reload, we disable the duplicate protection to ensure that self::$installed data is
// always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
// so we have to assume it does not, and that may result in duplicate data being returned when listing
// all installed packages for example
self::$installedIsLocalDir = false;
}
/**
* @return string
*/
private static function getSelfDir()
{
if (self::$selfDir === null) {
self::$selfDir = strtr(__DIR__, '\\', '/');
}
return self::$selfDir;
}
/**
* @return array[]
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
*/
private static function getInstalled()
{
if (null === self::$canGetVendors) {
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
}
$installed = array();
$copiedLocalDir = false;
if (self::$canGetVendors) {
$selfDir = self::getSelfDir();
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
$vendorDir = strtr($vendorDir, '\\', '/');
if (isset(self::$installedByVendor[$vendorDir])) {
$installed[] = self::$installedByVendor[$vendorDir];
} elseif (is_file($vendorDir.'/composer/installed.php')) {
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
$required = require $vendorDir.'/composer/installed.php';
self::$installedByVendor[$vendorDir] = $required;
$installed[] = $required;
if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
self::$installed = $required;
self::$installedIsLocalDir = true;
}
}
if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
$copiedLocalDir = true;
}
}
}
if (null === self::$installed) {
// only require the installed.php file if this file is loaded from its dumped location,
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
if (substr(__DIR__, -8, 1) !== 'C') {
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
$required = require __DIR__ . '/installed.php';
self::$installed = $required;
} else {
self::$installed = array();
}
}
if (self::$installed !== array() && !$copiedLocalDir) {
$installed[] = self::$installed;
}
return $installed;
}
}

View File

@@ -0,0 +1,21 @@
Copyright (c) Nils Adermann, Jordi Boggiano
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -0,0 +1,246 @@
<?php
// autoload_classmap.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
'AdvancedAds\\Abstracts\\Ad' => $baseDir . '/includes/abstracts/abstract-ad.php',
'AdvancedAds\\Abstracts\\Admin_List_Table' => $baseDir . '/includes/abstracts/abstract-admin-list-table.php',
'AdvancedAds\\Abstracts\\Data' => $baseDir . '/includes/abstracts/abstract-data.php',
'AdvancedAds\\Abstracts\\Factory' => $baseDir . '/includes/abstracts/abstract-factory.php',
'AdvancedAds\\Abstracts\\Group' => $baseDir . '/includes/abstracts/abstract-group.php',
'AdvancedAds\\Abstracts\\Placement' => $baseDir . '/includes/abstracts/abstract-placement.php',
'AdvancedAds\\Abstracts\\Placement_Type' => $baseDir . '/includes/abstracts/abstract-placement-type.php',
'AdvancedAds\\Abstracts\\Screen' => $baseDir . '/includes/abstracts/abstract-screen.php',
'AdvancedAds\\Abstracts\\Types' => $baseDir . '/includes/abstracts/abstract-types.php',
'AdvancedAds\\Admin\\AJAX' => $baseDir . '/includes/admin/class-ajax.php',
'AdvancedAds\\Admin\\Action_Links' => $baseDir . '/includes/admin/class-action-links.php',
'AdvancedAds\\Admin\\Ad_List_Table' => $baseDir . '/includes/admin/class-ad-list-table.php',
'AdvancedAds\\Admin\\Addon_Box' => $baseDir . '/includes/admin/class-addon-box.php',
'AdvancedAds\\Admin\\Addon_Updater' => $baseDir . '/includes/admin/class-addon-updater.php',
'AdvancedAds\\Admin\\Admin_Menu' => $baseDir . '/includes/admin/class-admin-menu.php',
'AdvancedAds\\Admin\\Admin_Notices' => $baseDir . '/includes/admin/class-admin-notices.php',
'AdvancedAds\\Admin\\Assets' => $baseDir . '/includes/admin/class-assets.php',
'AdvancedAds\\Admin\\Authors' => $baseDir . '/includes/admin/class-authors.php',
'AdvancedAds\\Admin\\Compatibility' => $baseDir . '/includes/admin/class-compatibility.php',
'AdvancedAds\\Admin\\EDD_Updater' => $baseDir . '/includes/admin/class-edd-updater.php',
'AdvancedAds\\Admin\\Groups_List_Table' => $baseDir . '/includes/admin/class-groups-list-table.php',
'AdvancedAds\\Admin\\Header' => $baseDir . '/includes/admin/class-header.php',
'AdvancedAds\\Admin\\List_Filters' => $baseDir . '/includes/admin/class-list-filters.php',
'AdvancedAds\\Admin\\Marketing' => $baseDir . '/includes/admin/class-marketing.php',
'AdvancedAds\\Admin\\Metabox_Ad' => $baseDir . '/includes/admin/class-metabox-ad.php',
'AdvancedAds\\Admin\\Metabox_Ad_Settings' => $baseDir . '/includes/admin/class-metabox-ad-settings.php',
'AdvancedAds\\Admin\\Metaboxes\\Ad_Adsense' => $baseDir . '/includes/admin/metaboxes/class-ad-adsense.php',
'AdvancedAds\\Admin\\Metaboxes\\Ad_Layout' => $baseDir . '/includes/admin/metaboxes/class-ad-layout.php',
'AdvancedAds\\Admin\\Metaboxes\\Ad_Parameters' => $baseDir . '/includes/admin/metaboxes/class-ad-parameters.php',
'AdvancedAds\\Admin\\Metaboxes\\Ad_Targeting' => $baseDir . '/includes/admin/metaboxes/class-ad-targeting.php',
'AdvancedAds\\Admin\\Metaboxes\\Ad_Types' => $baseDir . '/includes/admin/metaboxes/class-ad-types.php',
'AdvancedAds\\Admin\\Metaboxes\\Ad_Usage' => $baseDir . '/includes/admin/metaboxes/class-ad-usage.php',
'AdvancedAds\\Admin\\Misc' => $baseDir . '/includes/admin/class-misc.php',
'AdvancedAds\\Admin\\Page_Quick_Edit' => $baseDir . '/includes/admin/class-page-quick-edit.php',
'AdvancedAds\\Admin\\Pages\\Ads' => $baseDir . '/includes/admin/pages/class-ads.php',
'AdvancedAds\\Admin\\Pages\\Ads_Editing' => $baseDir . '/includes/admin/pages/class-ads-editing.php',
'AdvancedAds\\Admin\\Pages\\Dashboard' => $baseDir . '/includes/admin/pages/class-dashboard.php',
'AdvancedAds\\Admin\\Pages\\Groups' => $baseDir . '/includes/admin/pages/class-groups.php',
'AdvancedAds\\Admin\\Pages\\Onboarding' => $baseDir . '/includes/admin/pages/class-onboarding.php',
'AdvancedAds\\Admin\\Pages\\Placements' => $baseDir . '/includes/admin/pages/class-placements.php',
'AdvancedAds\\Admin\\Pages\\Settings' => $baseDir . '/includes/admin/pages/class-settings.php',
'AdvancedAds\\Admin\\Pages\\Tools' => $baseDir . '/includes/admin/pages/class-tools.php',
'AdvancedAds\\Admin\\Pages\\Ui_Toolkit' => $baseDir . '/includes/admin/pages/class-ui-toolkit.php',
'AdvancedAds\\Admin\\Placement\\Bulk_Edit' => $baseDir . '/includes/admin/placement/class-bulk-edit.php',
'AdvancedAds\\Admin\\Placement_Create_Modal' => $baseDir . '/includes/admin/class-placement-create-modal.php',
'AdvancedAds\\Admin\\Placement_Edit_Modal' => $baseDir . '/includes/admin/class-placement-edit-modal.php',
'AdvancedAds\\Admin\\Placement_List_Table' => $baseDir . '/includes/admin/class-placement-list-table.php',
'AdvancedAds\\Admin\\Placement_Quick_Edit' => $baseDir . '/includes/admin/class-placement-quick-edit.php',
'AdvancedAds\\Admin\\Plugin_Installer' => $baseDir . '/includes/admin/class-plugin-installer.php',
'AdvancedAds\\Admin\\Post_List' => $baseDir . '/includes/admin/class-post-list.php',
'AdvancedAds\\Admin\\Post_Types' => $baseDir . '/includes/admin/class-post-types.php',
'AdvancedAds\\Admin\\Quick_Bulk_Edit' => $baseDir . '/includes/admin/class-quick-bulk-edit.php',
'AdvancedAds\\Admin\\Screen_Options' => $baseDir . '/includes/admin/class-screen-options.php',
'AdvancedAds\\Admin\\Settings' => $baseDir . '/includes/admin/class-settings.php',
'AdvancedAds\\Admin\\Shortcode_Creator' => $baseDir . '/includes/admin/class-shortcode-creator.php',
'AdvancedAds\\Admin\\System_Info' => $baseDir . '/includes/admin/class-system-info.php',
'AdvancedAds\\Admin\\TinyMCE' => $baseDir . '/includes/admin/class-tinymce.php',
'AdvancedAds\\Admin\\Translation_Promo' => $baseDir . '/includes/admin/class-translation-promo.php',
'AdvancedAds\\Admin\\Upgrades' => $baseDir . '/includes/admin/class-upgrades.php',
'AdvancedAds\\Admin\\Version_Control' => $baseDir . '/includes/admin/class-version-control.php',
'AdvancedAds\\Admin\\Welcome' => $baseDir . '/includes/admin/class-welcome.php',
'AdvancedAds\\Admin\\WordPress_Dashboard' => $baseDir . '/includes/admin/class-wordpress-dashboard.php',
'AdvancedAds\\Ads\\Ad_Content' => $baseDir . '/includes/ads/class-ad-content.php',
'AdvancedAds\\Ads\\Ad_Dummy' => $baseDir . '/includes/ads/class-ad-dummy.php',
'AdvancedAds\\Ads\\Ad_Factory' => $baseDir . '/includes/ads/class-ad-factory.php',
'AdvancedAds\\Ads\\Ad_Group' => $baseDir . '/includes/ads/class-ad-group.php',
'AdvancedAds\\Ads\\Ad_Group_Relation' => $baseDir . '/includes/ads/class-ad-group-relation.php',
'AdvancedAds\\Ads\\Ad_Image' => $baseDir . '/includes/ads/class-ad-image.php',
'AdvancedAds\\Ads\\Ad_Plain' => $baseDir . '/includes/ads/class-ad-plain.php',
'AdvancedAds\\Ads\\Ad_Repository' => $baseDir . '/includes/ads/class-ad-repository.php',
'AdvancedAds\\Ads\\Ad_Types' => $baseDir . '/includes/ads/class-ad-types.php',
'AdvancedAds\\Ads\\Ads' => $baseDir . '/includes/ads/class-ads.php',
'AdvancedAds\\Ads\\Types\\AMP' => $baseDir . '/includes/ads/types/type-amp.php',
'AdvancedAds\\Ads\\Types\\Content' => $baseDir . '/includes/ads/types/type-content.php',
'AdvancedAds\\Ads\\Types\\Dummy' => $baseDir . '/includes/ads/types/type-dummy.php',
'AdvancedAds\\Ads\\Types\\GAM' => $baseDir . '/includes/ads/types/type-gam.php',
'AdvancedAds\\Ads\\Types\\Group' => $baseDir . '/includes/ads/types/type-group.php',
'AdvancedAds\\Ads\\Types\\Image' => $baseDir . '/includes/ads/types/type-image.php',
'AdvancedAds\\Ads\\Types\\Plain' => $baseDir . '/includes/ads/types/type-plain.php',
'AdvancedAds\\Ads\\Types\\Unknown' => $baseDir . '/includes/ads/types/type-unknown.php',
'AdvancedAds\\Assets_Registry' => $baseDir . '/includes/class-assets-registry.php',
'AdvancedAds\\Autoloader' => $baseDir . '/includes/class-autoloader.php',
'AdvancedAds\\Compatibility\\AAWP' => $baseDir . '/includes/compatibility/class-aawp.php',
'AdvancedAds\\Compatibility\\AAWP_Ad' => $baseDir . '/includes/compatibility/class-aawp-ad.php',
'AdvancedAds\\Compatibility\\Admin_Compatibility' => $baseDir . '/includes/compatibility/class-admin-compatibility.php',
'AdvancedAds\\Compatibility\\Capability_Manager' => $baseDir . '/includes/compatibility/class-capability-manager.php',
'AdvancedAds\\Compatibility\\Compatibility' => $baseDir . '/includes/compatibility/class-compatibility.php',
'AdvancedAds\\Compatibility\\Inline_JS' => $baseDir . '/includes/compatibility/class-inline-js.php',
'AdvancedAds\\Compatibility\\Peepso' => $baseDir . '/includes/compatibility/class-peepso.php',
'AdvancedAds\\Compatibility\\Peepso_Ad' => $baseDir . '/includes/compatibility/class-peepso-ad.php',
'AdvancedAds\\Constants' => $baseDir . '/includes/class-constants.php',
'AdvancedAds\\Crons\\Ads' => $baseDir . '/includes/crons/class-ads.php',
'AdvancedAds\\Entities' => $baseDir . '/includes/class-entities.php',
'AdvancedAds\\Framework\\Assets_Registry' => $vendorDir . '/advanced-ads/framework/src/class-assets-registry.php',
'AdvancedAds\\Framework\\Form\\Field' => $vendorDir . '/advanced-ads/framework/src/form/class-field.php',
'AdvancedAds\\Framework\\Form\\Field_Checkbox' => $vendorDir . '/advanced-ads/framework/src/form/class-field-checkbox.php',
'AdvancedAds\\Framework\\Form\\Field_Color' => $vendorDir . '/advanced-ads/framework/src/form/class-field-color.php',
'AdvancedAds\\Framework\\Form\\Field_Position' => $vendorDir . '/advanced-ads/framework/src/form/class-field-position.php',
'AdvancedAds\\Framework\\Form\\Field_Radio' => $vendorDir . '/advanced-ads/framework/src/form/class-field-radio.php',
'AdvancedAds\\Framework\\Form\\Field_Selector' => $vendorDir . '/advanced-ads/framework/src/form/class-field-selector.php',
'AdvancedAds\\Framework\\Form\\Field_Size' => $vendorDir . '/advanced-ads/framework/src/form/class-field-size.php',
'AdvancedAds\\Framework\\Form\\Field_Switch' => $vendorDir . '/advanced-ads/framework/src/form/class-field-switch.php',
'AdvancedAds\\Framework\\Form\\Field_Text' => $vendorDir . '/advanced-ads/framework/src/form/class-field-text.php',
'AdvancedAds\\Framework\\Form\\Field_Textarea' => $vendorDir . '/advanced-ads/framework/src/form/class-field-textarea.php',
'AdvancedAds\\Framework\\Form\\Form' => $vendorDir . '/advanced-ads/framework/src/form/class-form.php',
'AdvancedAds\\Framework\\Installation\\Install' => $vendorDir . '/advanced-ads/framework/src/installation/class-install.php',
'AdvancedAds\\Framework\\Interfaces\\Initializer_Interface' => $vendorDir . '/advanced-ads/framework/src/interfaces/interface-initializer.php',
'AdvancedAds\\Framework\\Interfaces\\Integration_Interface' => $vendorDir . '/advanced-ads/framework/src/interfaces/interface-integration.php',
'AdvancedAds\\Framework\\Interfaces\\Routes_Interface' => $vendorDir . '/advanced-ads/framework/src/interfaces/interface-routes.php',
'AdvancedAds\\Framework\\JSON' => $vendorDir . '/advanced-ads/framework/src/class-json.php',
'AdvancedAds\\Framework\\Loader' => $vendorDir . '/advanced-ads/framework/src/class-loader.php',
'AdvancedAds\\Framework\\Notices\\Manager' => $vendorDir . '/advanced-ads/framework/src/notices/class-manager.php',
'AdvancedAds\\Framework\\Notices\\Notice' => $vendorDir . '/advanced-ads/framework/src/notices/class-notice.php',
'AdvancedAds\\Framework\\Notices\\Storage' => $vendorDir . '/advanced-ads/framework/src/notices/class-storage.php',
'AdvancedAds\\Framework\\Updates' => $vendorDir . '/advanced-ads/framework/src/class-updates.php',
'AdvancedAds\\Framework\\Utilities\\Arr' => $vendorDir . '/advanced-ads/framework/src/utilities/class-arr.php',
'AdvancedAds\\Framework\\Utilities\\Formatting' => $vendorDir . '/advanced-ads/framework/src/utilities/class-formatting.php',
'AdvancedAds\\Framework\\Utilities\\HTML' => $vendorDir . '/advanced-ads/framework/src/utilities/class-html.php',
'AdvancedAds\\Framework\\Utilities\\Params' => $vendorDir . '/advanced-ads/framework/src/utilities/class-params.php',
'AdvancedAds\\Framework\\Utilities\\Str' => $vendorDir . '/advanced-ads/framework/src/utilities/class-str.php',
'AdvancedAds\\Frontend\\Ad_Display_Condition' => $baseDir . '/includes/frontend/class-ad-display-condition.php',
'AdvancedAds\\Frontend\\Ad_Renderer' => $baseDir . '/includes/frontend/class-ad-renderer.php',
'AdvancedAds\\Frontend\\Debug_Ads' => $baseDir . '/includes/frontend/class-debug-ads.php',
'AdvancedAds\\Frontend\\Manager' => $baseDir . '/includes/frontend/class-manager.php',
'AdvancedAds\\Frontend\\Scripts' => $baseDir . '/includes/frontend/class-scripts.php',
'AdvancedAds\\Frontend\\Stats' => $baseDir . '/includes/frontend/class-stats.php',
'AdvancedAds\\Groups\\Group_Ad_Relation' => $baseDir . '/includes/groups/class-group-ad-relation.php',
'AdvancedAds\\Groups\\Group_Factory' => $baseDir . '/includes/groups/class-group-factory.php',
'AdvancedAds\\Groups\\Group_Ordered' => $baseDir . '/includes/groups/class-group-ordered.php',
'AdvancedAds\\Groups\\Group_Repository' => $baseDir . '/includes/groups/class-group-repository.php',
'AdvancedAds\\Groups\\Group_Slider' => $baseDir . '/includes/groups/class-group-slider.php',
'AdvancedAds\\Groups\\Group_Standard' => $baseDir . '/includes/groups/class-group-standard.php',
'AdvancedAds\\Groups\\Group_Types' => $baseDir . '/includes/groups/class-group-types.php',
'AdvancedAds\\Groups\\Groups' => $baseDir . '/includes/groups/class-groups.php',
'AdvancedAds\\Groups\\Types\\Grid' => $baseDir . '/includes/groups/types/type-grid.php',
'AdvancedAds\\Groups\\Types\\Ordered' => $baseDir . '/includes/groups/types/type-ordered.php',
'AdvancedAds\\Groups\\Types\\Slider' => $baseDir . '/includes/groups/types/type-slider.php',
'AdvancedAds\\Groups\\Types\\Standard' => $baseDir . '/includes/groups/types/type-standard.php',
'AdvancedAds\\Groups\\Types\\Unknown' => $baseDir . '/includes/groups/types/type-unknown.php',
'AdvancedAds\\Importers\\Ad_Inserter' => $baseDir . '/includes/importers/class-ad-inserter.php',
'AdvancedAds\\Importers\\Ads_WP_Ads' => $baseDir . '/includes/importers/class-ads-wp-ads.php',
'AdvancedAds\\Importers\\Amp_WP_Ads' => $baseDir . '/includes/importers/class-amp-wp-ads.php',
'AdvancedAds\\Importers\\Api_Ads' => $baseDir . '/includes/importers/class-api-ads.php',
'AdvancedAds\\Importers\\Google_Sheet' => $baseDir . '/includes/importers/class-google-sheet.php',
'AdvancedAds\\Importers\\Importer' => $baseDir . '/includes/importers/abstract-importer.php',
'AdvancedAds\\Importers\\Manager' => $baseDir . '/includes/importers/class-manager.php',
'AdvancedAds\\Importers\\Plugin_Exporter' => $baseDir . '/includes/importers/class-plugin-exporter.php',
'AdvancedAds\\Importers\\Quick_Adsense' => $baseDir . '/includes/importers/class-quick-adsense.php',
'AdvancedAds\\Importers\\Tutorials' => $baseDir . '/includes/importers/class-tutorials.php',
'AdvancedAds\\Importers\\WP_Quads' => $baseDir . '/includes/importers/class-wp-quads.php',
'AdvancedAds\\Importers\\XML_Importer' => $baseDir . '/includes/importers/class-xml-importer.php',
'AdvancedAds\\Installation\\Capabilities' => $baseDir . '/includes/installation/class-capabilities.php',
'AdvancedAds\\Installation\\Compatibility' => $baseDir . '/includes/installation/class-compatibility.php',
'AdvancedAds\\Installation\\Install' => $baseDir . '/includes/installation/class-install.php',
'AdvancedAds\\Installation\\Uninstall' => $baseDir . '/includes/installation/class-uninstall.php',
'AdvancedAds\\Interfaces\\Ad_Interface' => $baseDir . '/includes/interfaces/interface-ad.php',
'AdvancedAds\\Interfaces\\Ad_Type' => $baseDir . '/includes/interfaces/interface-ad-type.php',
'AdvancedAds\\Interfaces\\Group_Interface' => $baseDir . '/includes/interfaces/interface-group.php',
'AdvancedAds\\Interfaces\\Group_Type' => $baseDir . '/includes/interfaces/interface-group-type.php',
'AdvancedAds\\Interfaces\\Importer' => $baseDir . '/includes/interfaces/interface-importer.php',
'AdvancedAds\\Interfaces\\Module_Interface' => $baseDir . '/includes/interfaces/interface-module.php',
'AdvancedAds\\Interfaces\\Placement_Interface' => $baseDir . '/includes/interfaces/interface-placement.php',
'AdvancedAds\\Interfaces\\Placement_Type' => $baseDir . '/includes/interfaces/interface-placement-type.php',
'AdvancedAds\\Modal' => $baseDir . '/includes/class-modal.php',
'AdvancedAds\\Modules' => $baseDir . '/includes/class-modules.php',
'AdvancedAds\\Modules\\OneClick\\Admin\\Admin' => $baseDir . '/modules/one-click/admin/class-admin.php',
'AdvancedAds\\Modules\\OneClick\\Admin\\Ajax' => $baseDir . '/modules/one-click/admin/class-ajax.php',
'AdvancedAds\\Modules\\OneClick\\AdsTxt\\AdsTxt' => $baseDir . '/modules/one-click/modules/adstxt/class-adstxt.php',
'AdvancedAds\\Modules\\OneClick\\AdsTxt\\Detector' => $baseDir . '/modules/one-click/modules/adstxt/class-detector.php',
'AdvancedAds\\Modules\\OneClick\\Header_Bidding' => $baseDir . '/modules/one-click/modules/class-header-bidding.php',
'AdvancedAds\\Modules\\OneClick\\Helpers' => $baseDir . '/modules/one-click/class-helpers.php',
'AdvancedAds\\Modules\\OneClick\\Options' => $baseDir . '/modules/one-click/class-options.php',
'AdvancedAds\\Modules\\OneClick\\Page_Parser' => $baseDir . '/modules/one-click/class-page-parser.php',
'AdvancedAds\\Modules\\OneClick\\Tags_Conversion' => $baseDir . '/modules/one-click/modules/class-tags-conversion.php',
'AdvancedAds\\Modules\\OneClick\\Traffic_Cop' => $baseDir . '/modules/one-click/modules/class-traffic-cop.php',
'AdvancedAds\\Modules\\OneClick\\Workflow' => $baseDir . '/modules/one-click/modules/class-workflow.php',
'AdvancedAds\\Modules\\ProductExperimentationFramework\\Module' => $baseDir . '/modules/pef/class-module.php',
'AdvancedAds\\Options' => $baseDir . '/includes/class-options.php',
'AdvancedAds\\Placements\\Placement_After_Content' => $baseDir . '/includes/placements/class-placement-after-content.php',
'AdvancedAds\\Placements\\Placement_Before_Content' => $baseDir . '/includes/placements/class-placement-before-content.php',
'AdvancedAds\\Placements\\Placement_Content' => $baseDir . '/includes/placements/class-placement-content.php',
'AdvancedAds\\Placements\\Placement_Factory' => $baseDir . '/includes/placements/class-placement-factory.php',
'AdvancedAds\\Placements\\Placement_Footer' => $baseDir . '/includes/placements/class-placement-footer.php',
'AdvancedAds\\Placements\\Placement_Header' => $baseDir . '/includes/placements/class-placement-header.php',
'AdvancedAds\\Placements\\Placement_Repository' => $baseDir . '/includes/placements/class-placement-repository.php',
'AdvancedAds\\Placements\\Placement_Sidebar_Widget' => $baseDir . '/includes/placements/class-placement-sidebar-widget.php',
'AdvancedAds\\Placements\\Placement_Standard' => $baseDir . '/includes/placements/class-placement-standard.php',
'AdvancedAds\\Placements\\Placement_Types' => $baseDir . '/includes/placements/class-placement-types.php',
'AdvancedAds\\Placements\\Placements' => $baseDir . '/includes/placements/class-placements.php',
'AdvancedAds\\Placements\\Types\\After_Content' => $baseDir . '/includes/placements/types/class-after-content.php',
'AdvancedAds\\Placements\\Types\\Before_Content' => $baseDir . '/includes/placements/types/class-before-content.php',
'AdvancedAds\\Placements\\Types\\Content' => $baseDir . '/includes/placements/types/class-content.php',
'AdvancedAds\\Placements\\Types\\Footer' => $baseDir . '/includes/placements/types/class-footer.php',
'AdvancedAds\\Placements\\Types\\Header' => $baseDir . '/includes/placements/types/class-header.php',
'AdvancedAds\\Placements\\Types\\Sidebar_Widget' => $baseDir . '/includes/placements/types/class-sidebar-widget.php',
'AdvancedAds\\Placements\\Types\\Standard' => $baseDir . '/includes/placements/types/class-standard.php',
'AdvancedAds\\Placements\\Types\\Unknown' => $baseDir . '/includes/placements/types/class-unknown.php',
'AdvancedAds\\Plugin' => $baseDir . '/includes/class-plugin.php',
'AdvancedAds\\Post_Data' => $baseDir . '/includes/class-post-data.php',
'AdvancedAds\\Rest\\Groups' => $baseDir . '/includes/rest/class-groups.php',
'AdvancedAds\\Rest\\OnBoarding' => $baseDir . '/includes/rest/class-onboarding.php',
'AdvancedAds\\Rest\\Page_Quick_Edit' => $baseDir . '/includes/rest/class-page-quick-edit.php',
'AdvancedAds\\Rest\\Placements' => $baseDir . '/includes/rest/class-placements.php',
'AdvancedAds\\Rest\\Utilities' => $baseDir . '/includes/rest/class-utilities.php',
'AdvancedAds\\Shortcodes' => $baseDir . '/includes/class-shortcodes.php',
'AdvancedAds\\Traits\\Entity' => $baseDir . '/includes/traits/class-entity.php',
'AdvancedAds\\Traits\\Extras' => $baseDir . '/includes/traits/class-extras.php',
'AdvancedAds\\Traits\\Wrapper' => $baseDir . '/includes/traits/class-wrapper.php',
'AdvancedAds\\Upgrades' => $baseDir . '/includes/class-upgrades.php',
'AdvancedAds\\Utilities\\Conditional' => $baseDir . '/includes/utilities/class-conditional.php',
'AdvancedAds\\Utilities\\Content_Injection' => $baseDir . '/includes/utilities/class-content-injection.php',
'AdvancedAds\\Utilities\\Data' => $baseDir . '/includes/utilities/class-data.php',
'AdvancedAds\\Utilities\\Sanitize' => $baseDir . '/includes/utilities/class-sanitize.php',
'AdvancedAds\\Utilities\\Testing' => $baseDir . '/includes/utilities/class-testing.php',
'AdvancedAds\\Utilities\\Validation' => $baseDir . '/includes/utilities/class-validation.php',
'AdvancedAds\\Utilities\\WordPress' => $baseDir . '/includes/utilities/class-wordpress.php',
'AdvancedAds\\Widget' => $baseDir . '/includes/class-widget.php',
'Advanced_Ads' => $baseDir . '/public/class-advanced-ads.php',
'Advanced_Ads_Ad_Health_Notices' => $baseDir . '/classes/ad-health-notices.php',
'Advanced_Ads_Ad_Network' => $baseDir . '/admin/includes/class-ad-network.php',
'Advanced_Ads_Ad_Network_Ad_Unit' => $baseDir . '/admin/includes/class-ad-network-ad-unit.php',
'Advanced_Ads_Ad_Positioning' => $baseDir . '/modules/ad-positioning/classes/ad-positioning.php',
'Advanced_Ads_Admin_Licenses' => $baseDir . '/admin/includes/class-licenses.php',
'Advanced_Ads_Admin_Notices' => $baseDir . '/admin/includes/class-notices.php',
'Advanced_Ads_Checks' => $baseDir . '/classes/checks.php',
'Advanced_Ads_Display_Conditions' => $baseDir . '/classes/display-conditions.php',
'Advanced_Ads_Filesystem' => $baseDir . '/classes/filesystem.php',
'Advanced_Ads_Frontend_Checks' => $baseDir . '/classes/frontend_checks.php',
'Advanced_Ads_In_Content_Injector' => $baseDir . '/classes/in-content-injector.php',
'Advanced_Ads_Inline_Css' => $baseDir . '/classes/inline-css.php',
'Advanced_Ads_ModuleLoader' => $baseDir . '/includes/load_modules.php',
'Advanced_Ads_Overview_Widgets_Callbacks' => $baseDir . '/admin/includes/class-overview-widgets.php',
'Advanced_Ads_Utils' => $baseDir . '/classes/utils.php',
'Advanced_Ads_Visitor_Conditions' => $baseDir . '/classes/visitor-conditions.php',
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
'Detection\\MobileDetect' => $vendorDir . '/mobiledetect/mobiledetectlib/src/MobileDetect.php',
'XML_Encoder' => $baseDir . '/includes/importers/class-xml-encoder.php',
);

View File

@@ -0,0 +1,10 @@
<?php
// autoload_files.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
'f9e7778b01e598acdf00361562d45920' => $vendorDir . '/advanced-ads/framework/src/assets.php',
);

View File

@@ -0,0 +1,9 @@
<?php
// autoload_namespaces.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
);

View File

@@ -0,0 +1,11 @@
<?php
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
'Detection\\' => array($vendorDir . '/mobiledetect/mobiledetectlib/src'),
'Advanced_Ads\\' => array($baseDir . '/src'),
);

View File

@@ -0,0 +1,51 @@
<?php
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit_AdvancedAds
{
private static $loader;
public static function loadClassLoader($class)
{
if ('Composer\Autoload\ClassLoader' === $class) {
require __DIR__ . '/ClassLoader.php';
}
}
/**
* @return \Composer\Autoload\ClassLoader
*/
public static function getLoader()
{
if (null !== self::$loader) {
return self::$loader;
}
require __DIR__ . '/platform_check.php';
spl_autoload_register(array('ComposerAutoloaderInit_AdvancedAds', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit_AdvancedAds', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit_AdvancedAds::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInit_AdvancedAds::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
require $file;
}
}, null, null);
foreach ($filesToLoad as $fileIdentifier => $file) {
$requireFile($fileIdentifier, $file);
}
return $loader;
}
}

View File

@@ -0,0 +1,284 @@
<?php
// autoload_static.php @generated by Composer
namespace Composer\Autoload;
class ComposerStaticInit_AdvancedAds
{
public static $files = array (
'f9e7778b01e598acdf00361562d45920' => __DIR__ . '/..' . '/advanced-ads/framework/src/assets.php',
);
public static $prefixLengthsPsr4 = array (
'D' =>
array (
'Detection\\' => 10,
),
'A' =>
array (
'Advanced_Ads\\' => 13,
),
);
public static $prefixDirsPsr4 = array (
'Detection\\' =>
array (
0 => __DIR__ . '/..' . '/mobiledetect/mobiledetectlib/src',
),
'Advanced_Ads\\' =>
array (
0 => __DIR__ . '/../..' . '/src',
),
);
public static $classMap = array (
'AdvancedAds\\Abstracts\\Ad' => __DIR__ . '/../..' . '/includes/abstracts/abstract-ad.php',
'AdvancedAds\\Abstracts\\Admin_List_Table' => __DIR__ . '/../..' . '/includes/abstracts/abstract-admin-list-table.php',
'AdvancedAds\\Abstracts\\Data' => __DIR__ . '/../..' . '/includes/abstracts/abstract-data.php',
'AdvancedAds\\Abstracts\\Factory' => __DIR__ . '/../..' . '/includes/abstracts/abstract-factory.php',
'AdvancedAds\\Abstracts\\Group' => __DIR__ . '/../..' . '/includes/abstracts/abstract-group.php',
'AdvancedAds\\Abstracts\\Placement' => __DIR__ . '/../..' . '/includes/abstracts/abstract-placement.php',
'AdvancedAds\\Abstracts\\Placement_Type' => __DIR__ . '/../..' . '/includes/abstracts/abstract-placement-type.php',
'AdvancedAds\\Abstracts\\Screen' => __DIR__ . '/../..' . '/includes/abstracts/abstract-screen.php',
'AdvancedAds\\Abstracts\\Types' => __DIR__ . '/../..' . '/includes/abstracts/abstract-types.php',
'AdvancedAds\\Admin\\AJAX' => __DIR__ . '/../..' . '/includes/admin/class-ajax.php',
'AdvancedAds\\Admin\\Action_Links' => __DIR__ . '/../..' . '/includes/admin/class-action-links.php',
'AdvancedAds\\Admin\\Ad_List_Table' => __DIR__ . '/../..' . '/includes/admin/class-ad-list-table.php',
'AdvancedAds\\Admin\\Addon_Box' => __DIR__ . '/../..' . '/includes/admin/class-addon-box.php',
'AdvancedAds\\Admin\\Addon_Updater' => __DIR__ . '/../..' . '/includes/admin/class-addon-updater.php',
'AdvancedAds\\Admin\\Admin_Menu' => __DIR__ . '/../..' . '/includes/admin/class-admin-menu.php',
'AdvancedAds\\Admin\\Admin_Notices' => __DIR__ . '/../..' . '/includes/admin/class-admin-notices.php',
'AdvancedAds\\Admin\\Assets' => __DIR__ . '/../..' . '/includes/admin/class-assets.php',
'AdvancedAds\\Admin\\Authors' => __DIR__ . '/../..' . '/includes/admin/class-authors.php',
'AdvancedAds\\Admin\\Compatibility' => __DIR__ . '/../..' . '/includes/admin/class-compatibility.php',
'AdvancedAds\\Admin\\EDD_Updater' => __DIR__ . '/../..' . '/includes/admin/class-edd-updater.php',
'AdvancedAds\\Admin\\Groups_List_Table' => __DIR__ . '/../..' . '/includes/admin/class-groups-list-table.php',
'AdvancedAds\\Admin\\Header' => __DIR__ . '/../..' . '/includes/admin/class-header.php',
'AdvancedAds\\Admin\\List_Filters' => __DIR__ . '/../..' . '/includes/admin/class-list-filters.php',
'AdvancedAds\\Admin\\Marketing' => __DIR__ . '/../..' . '/includes/admin/class-marketing.php',
'AdvancedAds\\Admin\\Metabox_Ad' => __DIR__ . '/../..' . '/includes/admin/class-metabox-ad.php',
'AdvancedAds\\Admin\\Metabox_Ad_Settings' => __DIR__ . '/../..' . '/includes/admin/class-metabox-ad-settings.php',
'AdvancedAds\\Admin\\Metaboxes\\Ad_Adsense' => __DIR__ . '/../..' . '/includes/admin/metaboxes/class-ad-adsense.php',
'AdvancedAds\\Admin\\Metaboxes\\Ad_Layout' => __DIR__ . '/../..' . '/includes/admin/metaboxes/class-ad-layout.php',
'AdvancedAds\\Admin\\Metaboxes\\Ad_Parameters' => __DIR__ . '/../..' . '/includes/admin/metaboxes/class-ad-parameters.php',
'AdvancedAds\\Admin\\Metaboxes\\Ad_Targeting' => __DIR__ . '/../..' . '/includes/admin/metaboxes/class-ad-targeting.php',
'AdvancedAds\\Admin\\Metaboxes\\Ad_Types' => __DIR__ . '/../..' . '/includes/admin/metaboxes/class-ad-types.php',
'AdvancedAds\\Admin\\Metaboxes\\Ad_Usage' => __DIR__ . '/../..' . '/includes/admin/metaboxes/class-ad-usage.php',
'AdvancedAds\\Admin\\Misc' => __DIR__ . '/../..' . '/includes/admin/class-misc.php',
'AdvancedAds\\Admin\\Page_Quick_Edit' => __DIR__ . '/../..' . '/includes/admin/class-page-quick-edit.php',
'AdvancedAds\\Admin\\Pages\\Ads' => __DIR__ . '/../..' . '/includes/admin/pages/class-ads.php',
'AdvancedAds\\Admin\\Pages\\Ads_Editing' => __DIR__ . '/../..' . '/includes/admin/pages/class-ads-editing.php',
'AdvancedAds\\Admin\\Pages\\Dashboard' => __DIR__ . '/../..' . '/includes/admin/pages/class-dashboard.php',
'AdvancedAds\\Admin\\Pages\\Groups' => __DIR__ . '/../..' . '/includes/admin/pages/class-groups.php',
'AdvancedAds\\Admin\\Pages\\Onboarding' => __DIR__ . '/../..' . '/includes/admin/pages/class-onboarding.php',
'AdvancedAds\\Admin\\Pages\\Placements' => __DIR__ . '/../..' . '/includes/admin/pages/class-placements.php',
'AdvancedAds\\Admin\\Pages\\Settings' => __DIR__ . '/../..' . '/includes/admin/pages/class-settings.php',
'AdvancedAds\\Admin\\Pages\\Tools' => __DIR__ . '/../..' . '/includes/admin/pages/class-tools.php',
'AdvancedAds\\Admin\\Pages\\Ui_Toolkit' => __DIR__ . '/../..' . '/includes/admin/pages/class-ui-toolkit.php',
'AdvancedAds\\Admin\\Placement\\Bulk_Edit' => __DIR__ . '/../..' . '/includes/admin/placement/class-bulk-edit.php',
'AdvancedAds\\Admin\\Placement_Create_Modal' => __DIR__ . '/../..' . '/includes/admin/class-placement-create-modal.php',
'AdvancedAds\\Admin\\Placement_Edit_Modal' => __DIR__ . '/../..' . '/includes/admin/class-placement-edit-modal.php',
'AdvancedAds\\Admin\\Placement_List_Table' => __DIR__ . '/../..' . '/includes/admin/class-placement-list-table.php',
'AdvancedAds\\Admin\\Placement_Quick_Edit' => __DIR__ . '/../..' . '/includes/admin/class-placement-quick-edit.php',
'AdvancedAds\\Admin\\Plugin_Installer' => __DIR__ . '/../..' . '/includes/admin/class-plugin-installer.php',
'AdvancedAds\\Admin\\Post_List' => __DIR__ . '/../..' . '/includes/admin/class-post-list.php',
'AdvancedAds\\Admin\\Post_Types' => __DIR__ . '/../..' . '/includes/admin/class-post-types.php',
'AdvancedAds\\Admin\\Quick_Bulk_Edit' => __DIR__ . '/../..' . '/includes/admin/class-quick-bulk-edit.php',
'AdvancedAds\\Admin\\Screen_Options' => __DIR__ . '/../..' . '/includes/admin/class-screen-options.php',
'AdvancedAds\\Admin\\Settings' => __DIR__ . '/../..' . '/includes/admin/class-settings.php',
'AdvancedAds\\Admin\\Shortcode_Creator' => __DIR__ . '/../..' . '/includes/admin/class-shortcode-creator.php',
'AdvancedAds\\Admin\\System_Info' => __DIR__ . '/../..' . '/includes/admin/class-system-info.php',
'AdvancedAds\\Admin\\TinyMCE' => __DIR__ . '/../..' . '/includes/admin/class-tinymce.php',
'AdvancedAds\\Admin\\Translation_Promo' => __DIR__ . '/../..' . '/includes/admin/class-translation-promo.php',
'AdvancedAds\\Admin\\Upgrades' => __DIR__ . '/../..' . '/includes/admin/class-upgrades.php',
'AdvancedAds\\Admin\\Version_Control' => __DIR__ . '/../..' . '/includes/admin/class-version-control.php',
'AdvancedAds\\Admin\\Welcome' => __DIR__ . '/../..' . '/includes/admin/class-welcome.php',
'AdvancedAds\\Admin\\WordPress_Dashboard' => __DIR__ . '/../..' . '/includes/admin/class-wordpress-dashboard.php',
'AdvancedAds\\Ads\\Ad_Content' => __DIR__ . '/../..' . '/includes/ads/class-ad-content.php',
'AdvancedAds\\Ads\\Ad_Dummy' => __DIR__ . '/../..' . '/includes/ads/class-ad-dummy.php',
'AdvancedAds\\Ads\\Ad_Factory' => __DIR__ . '/../..' . '/includes/ads/class-ad-factory.php',
'AdvancedAds\\Ads\\Ad_Group' => __DIR__ . '/../..' . '/includes/ads/class-ad-group.php',
'AdvancedAds\\Ads\\Ad_Group_Relation' => __DIR__ . '/../..' . '/includes/ads/class-ad-group-relation.php',
'AdvancedAds\\Ads\\Ad_Image' => __DIR__ . '/../..' . '/includes/ads/class-ad-image.php',
'AdvancedAds\\Ads\\Ad_Plain' => __DIR__ . '/../..' . '/includes/ads/class-ad-plain.php',
'AdvancedAds\\Ads\\Ad_Repository' => __DIR__ . '/../..' . '/includes/ads/class-ad-repository.php',
'AdvancedAds\\Ads\\Ad_Types' => __DIR__ . '/../..' . '/includes/ads/class-ad-types.php',
'AdvancedAds\\Ads\\Ads' => __DIR__ . '/../..' . '/includes/ads/class-ads.php',
'AdvancedAds\\Ads\\Types\\AMP' => __DIR__ . '/../..' . '/includes/ads/types/type-amp.php',
'AdvancedAds\\Ads\\Types\\Content' => __DIR__ . '/../..' . '/includes/ads/types/type-content.php',
'AdvancedAds\\Ads\\Types\\Dummy' => __DIR__ . '/../..' . '/includes/ads/types/type-dummy.php',
'AdvancedAds\\Ads\\Types\\GAM' => __DIR__ . '/../..' . '/includes/ads/types/type-gam.php',
'AdvancedAds\\Ads\\Types\\Group' => __DIR__ . '/../..' . '/includes/ads/types/type-group.php',
'AdvancedAds\\Ads\\Types\\Image' => __DIR__ . '/../..' . '/includes/ads/types/type-image.php',
'AdvancedAds\\Ads\\Types\\Plain' => __DIR__ . '/../..' . '/includes/ads/types/type-plain.php',
'AdvancedAds\\Ads\\Types\\Unknown' => __DIR__ . '/../..' . '/includes/ads/types/type-unknown.php',
'AdvancedAds\\Assets_Registry' => __DIR__ . '/../..' . '/includes/class-assets-registry.php',
'AdvancedAds\\Autoloader' => __DIR__ . '/../..' . '/includes/class-autoloader.php',
'AdvancedAds\\Compatibility\\AAWP' => __DIR__ . '/../..' . '/includes/compatibility/class-aawp.php',
'AdvancedAds\\Compatibility\\AAWP_Ad' => __DIR__ . '/../..' . '/includes/compatibility/class-aawp-ad.php',
'AdvancedAds\\Compatibility\\Admin_Compatibility' => __DIR__ . '/../..' . '/includes/compatibility/class-admin-compatibility.php',
'AdvancedAds\\Compatibility\\Capability_Manager' => __DIR__ . '/../..' . '/includes/compatibility/class-capability-manager.php',
'AdvancedAds\\Compatibility\\Compatibility' => __DIR__ . '/../..' . '/includes/compatibility/class-compatibility.php',
'AdvancedAds\\Compatibility\\Inline_JS' => __DIR__ . '/../..' . '/includes/compatibility/class-inline-js.php',
'AdvancedAds\\Compatibility\\Peepso' => __DIR__ . '/../..' . '/includes/compatibility/class-peepso.php',
'AdvancedAds\\Compatibility\\Peepso_Ad' => __DIR__ . '/../..' . '/includes/compatibility/class-peepso-ad.php',
'AdvancedAds\\Constants' => __DIR__ . '/../..' . '/includes/class-constants.php',
'AdvancedAds\\Crons\\Ads' => __DIR__ . '/../..' . '/includes/crons/class-ads.php',
'AdvancedAds\\Entities' => __DIR__ . '/../..' . '/includes/class-entities.php',
'AdvancedAds\\Framework\\Assets_Registry' => __DIR__ . '/..' . '/advanced-ads/framework/src/class-assets-registry.php',
'AdvancedAds\\Framework\\Form\\Field' => __DIR__ . '/..' . '/advanced-ads/framework/src/form/class-field.php',
'AdvancedAds\\Framework\\Form\\Field_Checkbox' => __DIR__ . '/..' . '/advanced-ads/framework/src/form/class-field-checkbox.php',
'AdvancedAds\\Framework\\Form\\Field_Color' => __DIR__ . '/..' . '/advanced-ads/framework/src/form/class-field-color.php',
'AdvancedAds\\Framework\\Form\\Field_Position' => __DIR__ . '/..' . '/advanced-ads/framework/src/form/class-field-position.php',
'AdvancedAds\\Framework\\Form\\Field_Radio' => __DIR__ . '/..' . '/advanced-ads/framework/src/form/class-field-radio.php',
'AdvancedAds\\Framework\\Form\\Field_Selector' => __DIR__ . '/..' . '/advanced-ads/framework/src/form/class-field-selector.php',
'AdvancedAds\\Framework\\Form\\Field_Size' => __DIR__ . '/..' . '/advanced-ads/framework/src/form/class-field-size.php',
'AdvancedAds\\Framework\\Form\\Field_Switch' => __DIR__ . '/..' . '/advanced-ads/framework/src/form/class-field-switch.php',
'AdvancedAds\\Framework\\Form\\Field_Text' => __DIR__ . '/..' . '/advanced-ads/framework/src/form/class-field-text.php',
'AdvancedAds\\Framework\\Form\\Field_Textarea' => __DIR__ . '/..' . '/advanced-ads/framework/src/form/class-field-textarea.php',
'AdvancedAds\\Framework\\Form\\Form' => __DIR__ . '/..' . '/advanced-ads/framework/src/form/class-form.php',
'AdvancedAds\\Framework\\Installation\\Install' => __DIR__ . '/..' . '/advanced-ads/framework/src/installation/class-install.php',
'AdvancedAds\\Framework\\Interfaces\\Initializer_Interface' => __DIR__ . '/..' . '/advanced-ads/framework/src/interfaces/interface-initializer.php',
'AdvancedAds\\Framework\\Interfaces\\Integration_Interface' => __DIR__ . '/..' . '/advanced-ads/framework/src/interfaces/interface-integration.php',
'AdvancedAds\\Framework\\Interfaces\\Routes_Interface' => __DIR__ . '/..' . '/advanced-ads/framework/src/interfaces/interface-routes.php',
'AdvancedAds\\Framework\\JSON' => __DIR__ . '/..' . '/advanced-ads/framework/src/class-json.php',
'AdvancedAds\\Framework\\Loader' => __DIR__ . '/..' . '/advanced-ads/framework/src/class-loader.php',
'AdvancedAds\\Framework\\Notices\\Manager' => __DIR__ . '/..' . '/advanced-ads/framework/src/notices/class-manager.php',
'AdvancedAds\\Framework\\Notices\\Notice' => __DIR__ . '/..' . '/advanced-ads/framework/src/notices/class-notice.php',
'AdvancedAds\\Framework\\Notices\\Storage' => __DIR__ . '/..' . '/advanced-ads/framework/src/notices/class-storage.php',
'AdvancedAds\\Framework\\Updates' => __DIR__ . '/..' . '/advanced-ads/framework/src/class-updates.php',
'AdvancedAds\\Framework\\Utilities\\Arr' => __DIR__ . '/..' . '/advanced-ads/framework/src/utilities/class-arr.php',
'AdvancedAds\\Framework\\Utilities\\Formatting' => __DIR__ . '/..' . '/advanced-ads/framework/src/utilities/class-formatting.php',
'AdvancedAds\\Framework\\Utilities\\HTML' => __DIR__ . '/..' . '/advanced-ads/framework/src/utilities/class-html.php',
'AdvancedAds\\Framework\\Utilities\\Params' => __DIR__ . '/..' . '/advanced-ads/framework/src/utilities/class-params.php',
'AdvancedAds\\Framework\\Utilities\\Str' => __DIR__ . '/..' . '/advanced-ads/framework/src/utilities/class-str.php',
'AdvancedAds\\Frontend\\Ad_Display_Condition' => __DIR__ . '/../..' . '/includes/frontend/class-ad-display-condition.php',
'AdvancedAds\\Frontend\\Ad_Renderer' => __DIR__ . '/../..' . '/includes/frontend/class-ad-renderer.php',
'AdvancedAds\\Frontend\\Debug_Ads' => __DIR__ . '/../..' . '/includes/frontend/class-debug-ads.php',
'AdvancedAds\\Frontend\\Manager' => __DIR__ . '/../..' . '/includes/frontend/class-manager.php',
'AdvancedAds\\Frontend\\Scripts' => __DIR__ . '/../..' . '/includes/frontend/class-scripts.php',
'AdvancedAds\\Frontend\\Stats' => __DIR__ . '/../..' . '/includes/frontend/class-stats.php',
'AdvancedAds\\Groups\\Group_Ad_Relation' => __DIR__ . '/../..' . '/includes/groups/class-group-ad-relation.php',
'AdvancedAds\\Groups\\Group_Factory' => __DIR__ . '/../..' . '/includes/groups/class-group-factory.php',
'AdvancedAds\\Groups\\Group_Ordered' => __DIR__ . '/../..' . '/includes/groups/class-group-ordered.php',
'AdvancedAds\\Groups\\Group_Repository' => __DIR__ . '/../..' . '/includes/groups/class-group-repository.php',
'AdvancedAds\\Groups\\Group_Slider' => __DIR__ . '/../..' . '/includes/groups/class-group-slider.php',
'AdvancedAds\\Groups\\Group_Standard' => __DIR__ . '/../..' . '/includes/groups/class-group-standard.php',
'AdvancedAds\\Groups\\Group_Types' => __DIR__ . '/../..' . '/includes/groups/class-group-types.php',
'AdvancedAds\\Groups\\Groups' => __DIR__ . '/../..' . '/includes/groups/class-groups.php',
'AdvancedAds\\Groups\\Types\\Grid' => __DIR__ . '/../..' . '/includes/groups/types/type-grid.php',
'AdvancedAds\\Groups\\Types\\Ordered' => __DIR__ . '/../..' . '/includes/groups/types/type-ordered.php',
'AdvancedAds\\Groups\\Types\\Slider' => __DIR__ . '/../..' . '/includes/groups/types/type-slider.php',
'AdvancedAds\\Groups\\Types\\Standard' => __DIR__ . '/../..' . '/includes/groups/types/type-standard.php',
'AdvancedAds\\Groups\\Types\\Unknown' => __DIR__ . '/../..' . '/includes/groups/types/type-unknown.php',
'AdvancedAds\\Importers\\Ad_Inserter' => __DIR__ . '/../..' . '/includes/importers/class-ad-inserter.php',
'AdvancedAds\\Importers\\Ads_WP_Ads' => __DIR__ . '/../..' . '/includes/importers/class-ads-wp-ads.php',
'AdvancedAds\\Importers\\Amp_WP_Ads' => __DIR__ . '/../..' . '/includes/importers/class-amp-wp-ads.php',
'AdvancedAds\\Importers\\Api_Ads' => __DIR__ . '/../..' . '/includes/importers/class-api-ads.php',
'AdvancedAds\\Importers\\Google_Sheet' => __DIR__ . '/../..' . '/includes/importers/class-google-sheet.php',
'AdvancedAds\\Importers\\Importer' => __DIR__ . '/../..' . '/includes/importers/abstract-importer.php',
'AdvancedAds\\Importers\\Manager' => __DIR__ . '/../..' . '/includes/importers/class-manager.php',
'AdvancedAds\\Importers\\Plugin_Exporter' => __DIR__ . '/../..' . '/includes/importers/class-plugin-exporter.php',
'AdvancedAds\\Importers\\Quick_Adsense' => __DIR__ . '/../..' . '/includes/importers/class-quick-adsense.php',
'AdvancedAds\\Importers\\Tutorials' => __DIR__ . '/../..' . '/includes/importers/class-tutorials.php',
'AdvancedAds\\Importers\\WP_Quads' => __DIR__ . '/../..' . '/includes/importers/class-wp-quads.php',
'AdvancedAds\\Importers\\XML_Importer' => __DIR__ . '/../..' . '/includes/importers/class-xml-importer.php',
'AdvancedAds\\Installation\\Capabilities' => __DIR__ . '/../..' . '/includes/installation/class-capabilities.php',
'AdvancedAds\\Installation\\Compatibility' => __DIR__ . '/../..' . '/includes/installation/class-compatibility.php',
'AdvancedAds\\Installation\\Install' => __DIR__ . '/../..' . '/includes/installation/class-install.php',
'AdvancedAds\\Installation\\Uninstall' => __DIR__ . '/../..' . '/includes/installation/class-uninstall.php',
'AdvancedAds\\Interfaces\\Ad_Interface' => __DIR__ . '/../..' . '/includes/interfaces/interface-ad.php',
'AdvancedAds\\Interfaces\\Ad_Type' => __DIR__ . '/../..' . '/includes/interfaces/interface-ad-type.php',
'AdvancedAds\\Interfaces\\Group_Interface' => __DIR__ . '/../..' . '/includes/interfaces/interface-group.php',
'AdvancedAds\\Interfaces\\Group_Type' => __DIR__ . '/../..' . '/includes/interfaces/interface-group-type.php',
'AdvancedAds\\Interfaces\\Importer' => __DIR__ . '/../..' . '/includes/interfaces/interface-importer.php',
'AdvancedAds\\Interfaces\\Module_Interface' => __DIR__ . '/../..' . '/includes/interfaces/interface-module.php',
'AdvancedAds\\Interfaces\\Placement_Interface' => __DIR__ . '/../..' . '/includes/interfaces/interface-placement.php',
'AdvancedAds\\Interfaces\\Placement_Type' => __DIR__ . '/../..' . '/includes/interfaces/interface-placement-type.php',
'AdvancedAds\\Modal' => __DIR__ . '/../..' . '/includes/class-modal.php',
'AdvancedAds\\Modules' => __DIR__ . '/../..' . '/includes/class-modules.php',
'AdvancedAds\\Modules\\OneClick\\Admin\\Admin' => __DIR__ . '/../..' . '/modules/one-click/admin/class-admin.php',
'AdvancedAds\\Modules\\OneClick\\Admin\\Ajax' => __DIR__ . '/../..' . '/modules/one-click/admin/class-ajax.php',
'AdvancedAds\\Modules\\OneClick\\AdsTxt\\AdsTxt' => __DIR__ . '/../..' . '/modules/one-click/modules/adstxt/class-adstxt.php',
'AdvancedAds\\Modules\\OneClick\\AdsTxt\\Detector' => __DIR__ . '/../..' . '/modules/one-click/modules/adstxt/class-detector.php',
'AdvancedAds\\Modules\\OneClick\\Header_Bidding' => __DIR__ . '/../..' . '/modules/one-click/modules/class-header-bidding.php',
'AdvancedAds\\Modules\\OneClick\\Helpers' => __DIR__ . '/../..' . '/modules/one-click/class-helpers.php',
'AdvancedAds\\Modules\\OneClick\\Options' => __DIR__ . '/../..' . '/modules/one-click/class-options.php',
'AdvancedAds\\Modules\\OneClick\\Page_Parser' => __DIR__ . '/../..' . '/modules/one-click/class-page-parser.php',
'AdvancedAds\\Modules\\OneClick\\Tags_Conversion' => __DIR__ . '/../..' . '/modules/one-click/modules/class-tags-conversion.php',
'AdvancedAds\\Modules\\OneClick\\Traffic_Cop' => __DIR__ . '/../..' . '/modules/one-click/modules/class-traffic-cop.php',
'AdvancedAds\\Modules\\OneClick\\Workflow' => __DIR__ . '/../..' . '/modules/one-click/modules/class-workflow.php',
'AdvancedAds\\Modules\\ProductExperimentationFramework\\Module' => __DIR__ . '/../..' . '/modules/pef/class-module.php',
'AdvancedAds\\Options' => __DIR__ . '/../..' . '/includes/class-options.php',
'AdvancedAds\\Placements\\Placement_After_Content' => __DIR__ . '/../..' . '/includes/placements/class-placement-after-content.php',
'AdvancedAds\\Placements\\Placement_Before_Content' => __DIR__ . '/../..' . '/includes/placements/class-placement-before-content.php',
'AdvancedAds\\Placements\\Placement_Content' => __DIR__ . '/../..' . '/includes/placements/class-placement-content.php',
'AdvancedAds\\Placements\\Placement_Factory' => __DIR__ . '/../..' . '/includes/placements/class-placement-factory.php',
'AdvancedAds\\Placements\\Placement_Footer' => __DIR__ . '/../..' . '/includes/placements/class-placement-footer.php',
'AdvancedAds\\Placements\\Placement_Header' => __DIR__ . '/../..' . '/includes/placements/class-placement-header.php',
'AdvancedAds\\Placements\\Placement_Repository' => __DIR__ . '/../..' . '/includes/placements/class-placement-repository.php',
'AdvancedAds\\Placements\\Placement_Sidebar_Widget' => __DIR__ . '/../..' . '/includes/placements/class-placement-sidebar-widget.php',
'AdvancedAds\\Placements\\Placement_Standard' => __DIR__ . '/../..' . '/includes/placements/class-placement-standard.php',
'AdvancedAds\\Placements\\Placement_Types' => __DIR__ . '/../..' . '/includes/placements/class-placement-types.php',
'AdvancedAds\\Placements\\Placements' => __DIR__ . '/../..' . '/includes/placements/class-placements.php',
'AdvancedAds\\Placements\\Types\\After_Content' => __DIR__ . '/../..' . '/includes/placements/types/class-after-content.php',
'AdvancedAds\\Placements\\Types\\Before_Content' => __DIR__ . '/../..' . '/includes/placements/types/class-before-content.php',
'AdvancedAds\\Placements\\Types\\Content' => __DIR__ . '/../..' . '/includes/placements/types/class-content.php',
'AdvancedAds\\Placements\\Types\\Footer' => __DIR__ . '/../..' . '/includes/placements/types/class-footer.php',
'AdvancedAds\\Placements\\Types\\Header' => __DIR__ . '/../..' . '/includes/placements/types/class-header.php',
'AdvancedAds\\Placements\\Types\\Sidebar_Widget' => __DIR__ . '/../..' . '/includes/placements/types/class-sidebar-widget.php',
'AdvancedAds\\Placements\\Types\\Standard' => __DIR__ . '/../..' . '/includes/placements/types/class-standard.php',
'AdvancedAds\\Placements\\Types\\Unknown' => __DIR__ . '/../..' . '/includes/placements/types/class-unknown.php',
'AdvancedAds\\Plugin' => __DIR__ . '/../..' . '/includes/class-plugin.php',
'AdvancedAds\\Post_Data' => __DIR__ . '/../..' . '/includes/class-post-data.php',
'AdvancedAds\\Rest\\Groups' => __DIR__ . '/../..' . '/includes/rest/class-groups.php',
'AdvancedAds\\Rest\\OnBoarding' => __DIR__ . '/../..' . '/includes/rest/class-onboarding.php',
'AdvancedAds\\Rest\\Page_Quick_Edit' => __DIR__ . '/../..' . '/includes/rest/class-page-quick-edit.php',
'AdvancedAds\\Rest\\Placements' => __DIR__ . '/../..' . '/includes/rest/class-placements.php',
'AdvancedAds\\Rest\\Utilities' => __DIR__ . '/../..' . '/includes/rest/class-utilities.php',
'AdvancedAds\\Shortcodes' => __DIR__ . '/../..' . '/includes/class-shortcodes.php',
'AdvancedAds\\Traits\\Entity' => __DIR__ . '/../..' . '/includes/traits/class-entity.php',
'AdvancedAds\\Traits\\Extras' => __DIR__ . '/../..' . '/includes/traits/class-extras.php',
'AdvancedAds\\Traits\\Wrapper' => __DIR__ . '/../..' . '/includes/traits/class-wrapper.php',
'AdvancedAds\\Upgrades' => __DIR__ . '/../..' . '/includes/class-upgrades.php',
'AdvancedAds\\Utilities\\Conditional' => __DIR__ . '/../..' . '/includes/utilities/class-conditional.php',
'AdvancedAds\\Utilities\\Content_Injection' => __DIR__ . '/../..' . '/includes/utilities/class-content-injection.php',
'AdvancedAds\\Utilities\\Data' => __DIR__ . '/../..' . '/includes/utilities/class-data.php',
'AdvancedAds\\Utilities\\Sanitize' => __DIR__ . '/../..' . '/includes/utilities/class-sanitize.php',
'AdvancedAds\\Utilities\\Testing' => __DIR__ . '/../..' . '/includes/utilities/class-testing.php',
'AdvancedAds\\Utilities\\Validation' => __DIR__ . '/../..' . '/includes/utilities/class-validation.php',
'AdvancedAds\\Utilities\\WordPress' => __DIR__ . '/../..' . '/includes/utilities/class-wordpress.php',
'AdvancedAds\\Widget' => __DIR__ . '/../..' . '/includes/class-widget.php',
'Advanced_Ads' => __DIR__ . '/../..' . '/public/class-advanced-ads.php',
'Advanced_Ads_Ad_Health_Notices' => __DIR__ . '/../..' . '/classes/ad-health-notices.php',
'Advanced_Ads_Ad_Network' => __DIR__ . '/../..' . '/admin/includes/class-ad-network.php',
'Advanced_Ads_Ad_Network_Ad_Unit' => __DIR__ . '/../..' . '/admin/includes/class-ad-network-ad-unit.php',
'Advanced_Ads_Ad_Positioning' => __DIR__ . '/../..' . '/modules/ad-positioning/classes/ad-positioning.php',
'Advanced_Ads_Admin_Licenses' => __DIR__ . '/../..' . '/admin/includes/class-licenses.php',
'Advanced_Ads_Admin_Notices' => __DIR__ . '/../..' . '/admin/includes/class-notices.php',
'Advanced_Ads_Checks' => __DIR__ . '/../..' . '/classes/checks.php',
'Advanced_Ads_Display_Conditions' => __DIR__ . '/../..' . '/classes/display-conditions.php',
'Advanced_Ads_Filesystem' => __DIR__ . '/../..' . '/classes/filesystem.php',
'Advanced_Ads_Frontend_Checks' => __DIR__ . '/../..' . '/classes/frontend_checks.php',
'Advanced_Ads_In_Content_Injector' => __DIR__ . '/../..' . '/classes/in-content-injector.php',
'Advanced_Ads_Inline_Css' => __DIR__ . '/../..' . '/classes/inline-css.php',
'Advanced_Ads_ModuleLoader' => __DIR__ . '/../..' . '/includes/load_modules.php',
'Advanced_Ads_Overview_Widgets_Callbacks' => __DIR__ . '/../..' . '/admin/includes/class-overview-widgets.php',
'Advanced_Ads_Utils' => __DIR__ . '/../..' . '/classes/utils.php',
'Advanced_Ads_Visitor_Conditions' => __DIR__ . '/../..' . '/classes/visitor-conditions.php',
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
'Detection\\MobileDetect' => __DIR__ . '/..' . '/mobiledetect/mobiledetectlib/src/MobileDetect.php',
'XML_Encoder' => __DIR__ . '/../..' . '/includes/importers/class-xml-encoder.php',
);
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit_AdvancedAds::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit_AdvancedAds::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit_AdvancedAds::$classMap;
}, null, ClassLoader::class);
}
}

View File

@@ -0,0 +1,126 @@
{
"packages": [
{
"name": "advanced-ads/framework",
"version": "dev-main",
"version_normalized": "dev-main",
"source": {
"type": "git",
"url": "https://github.com/advanced-ads/framework.git",
"reference": "bafe2c32b1530cfb18d8b738adb9524f8406b9aa"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/advanced-ads/framework/zipball/bafe2c32b1530cfb18d8b738adb9524f8406b9aa",
"reference": "bafe2c32b1530cfb18d8b738adb9524f8406b9aa",
"shasum": ""
},
"require": {
"php": ">=7.2"
},
"require-dev": {
"phpcompatibility/phpcompatibility-wp": "*",
"wp-coding-standards/wpcs": "^3.0.0"
},
"time": "2025-03-10T12:31:18+00:00",
"default-branch": true,
"type": "wordpress-plugin",
"installation-source": "dist",
"autoload": {
"files": [
"src/assets.php"
],
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"GPL-3.0-or-later"
],
"authors": [
{
"name": "Advanced Ads",
"email": "info@wpadvancedads.com",
"homepage": "https://wpadvancedads.com"
}
],
"description": "Place ads on various positions within Genesis themes",
"homepage": "https://wpadvancedads.com/",
"support": {
"issues": "https://github.com/advanced-ads/framework/issues",
"source": "https://github.com/advanced-ads/framework/tree/main"
},
"install-path": "../advanced-ads/framework"
},
{
"name": "mobiledetect/mobiledetectlib",
"version": "3.74.3",
"version_normalized": "3.74.3.0",
"source": {
"type": "git",
"url": "https://github.com/serbanghita/Mobile-Detect.git",
"reference": "39582ab62f86b40e4edb698159f895929a29c346"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/serbanghita/Mobile-Detect/zipball/39582ab62f86b40e4edb698159f895929a29c346",
"reference": "39582ab62f86b40e4edb698159f895929a29c346",
"shasum": ""
},
"require": {
"php": ">=7.4"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.14",
"phpunit/phpunit": "^9.6",
"squizlabs/php_codesniffer": "^3.7"
},
"time": "2023-10-27T16:28:04+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"Detection\\": "src/"
},
"classmap": [
"src/MobileDetect.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Serban Ghita",
"email": "serbanghita@gmail.com",
"homepage": "https://mobiledetect.net",
"role": "Developer"
}
],
"description": "Mobile_Detect is a lightweight PHP class for detecting mobile devices. It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment.",
"homepage": "https://github.com/serbanghita/Mobile-Detect",
"keywords": [
"detect mobile devices",
"mobile",
"mobile detect",
"mobile detector",
"php mobile detect"
],
"support": {
"issues": "https://github.com/serbanghita/Mobile-Detect/issues",
"source": "https://github.com/serbanghita/Mobile-Detect/tree/3.74.3"
},
"funding": [
{
"url": "https://github.com/serbanghita",
"type": "github"
}
],
"install-path": "../mobiledetect/mobiledetectlib"
}
],
"dev": false,
"dev-package-names": []
}

View File

@@ -0,0 +1,43 @@
<?php return array(
'root' => array(
'name' => 'advanced-ads/advanced-ads',
'pretty_version' => '1.48.2',
'version' => '1.48.2.0',
'reference' => null,
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev' => false,
),
'versions' => array(
'advanced-ads/advanced-ads' => array(
'pretty_version' => '1.48.2',
'version' => '1.48.2.0',
'reference' => null,
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev_requirement' => false,
),
'advanced-ads/framework' => array(
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => 'bafe2c32b1530cfb18d8b738adb9524f8406b9aa',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../advanced-ads/framework',
'aliases' => array(
0 => '9999999-dev',
),
'dev_requirement' => false,
),
'mobiledetect/mobiledetectlib' => array(
'pretty_version' => '3.74.3',
'version' => '3.74.3.0',
'reference' => '39582ab62f86b40e4edb698159f895929a29c346',
'type' => 'library',
'install_path' => __DIR__ . '/../mobiledetect/mobiledetectlib',
'aliases' => array(),
'dev_requirement' => false,
),
),
);

View File

@@ -0,0 +1,25 @@
<?php
// platform_check.php @generated by Composer
$issues = array();
if (!(PHP_VERSION_ID >= 70400)) {
$issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running ' . PHP_VERSION . '.';
}
if ($issues) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
} elseif (!headers_sent()) {
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
}
}
throw new \RuntimeException(
'Composer detected issues in your platform: ' . implode(' ', $issues)
);
}

View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021 Şerban Ghiţă, Nick Ilyin and contributors.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,16 @@
app:
restart: 'on-failure'
image: php:7
working_dir: /app
command: vendor/bin/phpunit -v -c tests/phpunit.xml --coverage-text --strict-coverage --stop-on-risky
ports:
- "8000:8000"
volumes:
- .:/app
composer:
restart: 'no'
image: composer/composer:php7
command: install
volumes:
- .:/app

File diff suppressed because one or more lines are too long