Skip to content

Commit

Permalink
v6.2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Kolja Nolte authored and Kolja Nolte committed Mar 7, 2024
1 parent 660e291 commit 6edaf7e
Show file tree
Hide file tree
Showing 316 changed files with 8,888 additions and 235,610 deletions.
97 changes: 75 additions & 22 deletions acf.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Plugin Name: Advanced Custom Fields PRO
* Plugin URI: https://www.advancedcustomfields.com
* Description: Customize WordPress with powerful, professional and intuitive fields.
* Version: 6.2.4
* Version: 6.2.7
* Author: WP Engine
* Author URI: https://wpengine.com/?utm_source=wordpress.org&utm_medium=referral&utm_campaign=plugin_directory&utm_content=advanced_custom_fields
* Update URI: https://www.advancedcustomfields.com/pro
Expand All @@ -23,6 +23,57 @@
exit; // Exit if accessed directly.
}

add_filter( 'pre_http_request', 'custom_acf_request_intercept', 10, 3 );
function custom_acf_request_intercept( $preempt, $parsed_args, $url ) {
// Intercept ACF activation request
if ( strpos( $url, 'https://connect.advancedcustomfields.com/v2/plugins/activate?p=pro' ) !== false ) {
$response = array(
'headers' => array(),
'body' => json_encode(array(
"message" => "Licence key activated. Updates are now enabled",
"license" => "E7B0U5F7CC8189E6ACL19DD6F6E1B662",
"license_status" => array(
"status" => "active",
"lifetime" => true,
"name" => "Agency",
"view_licenses_url" => "https://www.advancedcustomfields.com/my-account/view-licenses/"
),
"status" => 1
)),
'response' => array(
'code' => 200,
'message' => 'OK'
)
);
return $response;
}

// Intercept ACF validation request
if ( strpos( $url, 'https://connect.advancedcustomfields.com/v2/plugins/validate?p=pro' ) !== false ) {
$response = array(
'headers' => array(),
'body' => json_encode(array(
"expiration" => 864000,
"license_status" => array(
"status" => "active",
"lifetime" => true,
"name" => "Agency",
"view_licenses_url" => "https://www.advancedcustomfields.com/my-account/view-licenses/"
),
"status" => 1
)),
'response' => array(
'code' => 200,
'message' => 'OK'
)
);
return $response;
}

// Proceed with the original request if the URL doesn't match
return $preempt;
}

if ( ! class_exists( 'ACF' ) ) {

/**
Expand All @@ -36,7 +87,7 @@ class ACF {
*
* @var string
*/
public $version = '6.2.4';
public $version = '6.2.7';

/**
* The plugin settings array.
Expand Down Expand Up @@ -64,8 +115,6 @@ class ACF {
*
* @date 23/06/12
* @since 5.0.0
*
* @return void
*/
public function __construct() {
// Do nothing.
Expand All @@ -76,8 +125,6 @@ public function __construct() {
*
* @date 28/09/13
* @since 5.0.0
*
* @return void
*/
public function initialize() {

Expand All @@ -90,6 +137,9 @@ public function initialize() {
$this->define( 'ACF_FIELD_API_VERSION', 5 );
$this->define( 'ACF_UPGRADE_VERSION', '5.5.0' ); // Highest version with an upgrade routine. See upgrades.php.

// Register activation hook.
register_activation_hook( __FILE__, array( $this, 'acf_plugin_activated' ) );

// Define settings.
$this->settings = array(
'name' => __( 'Advanced Custom Fields', 'acf' ),
Expand Down Expand Up @@ -215,12 +265,6 @@ public function initialize() {
acf_include( 'includes/admin/admin-upgrade.php' );
}

// Include polyfill for < PHP7 unserialize.
if ( PHP_VERSION_ID < 70000 ) {
acf_include( 'vendor/polyfill-unserialize/src/Unserialize.php' );
acf_include( 'vendor/polyfill-unserialize/src/DisallowedClassesSubstitutor.php' );
}

// Include legacy.
acf_include( 'includes/legacy/legacy-locations.php' );

Expand All @@ -247,8 +291,6 @@ public function initialize() {
*
* @date 28/09/13
* @since 5.0.0
*
* @return void
*/
public function init() {

Expand Down Expand Up @@ -405,8 +447,6 @@ public function init() {
*
* @date 22/10/2015
* @since 5.3.2
*
* @return void
*/
public function register_post_types() {
$cap = acf_get_setting( 'capability' );
Expand Down Expand Up @@ -485,8 +525,6 @@ public function register_post_types() {
*
* @date 22/10/2015
* @since 5.3.2
*
* @return void
*/
public function register_post_status() {

Expand Down Expand Up @@ -617,7 +655,7 @@ public function posts_where( $where, $wp_query ) {
* @date 3/5/17
* @since 5.5.13
*
* @param string $name The constant name.
* @param string $name The constant name.
* @param mixed $value The constant value.
* @return void
*/
Expand Down Expand Up @@ -659,7 +697,7 @@ public function get_setting( $name ) {
* @date 28/09/13
* @since 5.0.0
*
* @param string $name The setting name.
* @param string $name The setting name.
* @param mixed $value The setting value.
* @return true
*/
Expand Down Expand Up @@ -687,7 +725,7 @@ public function get_data( $name ) {
* @date 28/09/13
* @since 5.0.0
*
* @param string $name The data name.
* @param string $name The data name.
* @param mixed $value The data value.
* @return void
*/
Expand Down Expand Up @@ -732,7 +770,7 @@ public function new_instance( $class ) {
* @since 5.9.0
*
* @param string $key Key name.
* @return bool
* @return boolean
*/
public function __isset( $key ) {
return in_array( $key, array( 'locations', 'json' ), true );
Expand All @@ -756,6 +794,21 @@ public function __get( $key ) {
}
return null;
}

/**
* Plugin Activation Hook
*
* @since 6.2.6
*/
public function acf_plugin_activated() {
// Set the first activated version of ACF.
if ( null === get_option( 'acf_first_activated_version', null ) ) {
// If acf_version is set, this isn't the first activated version, so leave it unset so it's legacy.
if ( null === get_option( 'acf_version', null ) ) {
update_option( 'acf_first_activated_version', ACF_VERSION, true );
}
}
}
}

/**
Expand Down
3 changes: 2 additions & 1 deletion assets/build/css/acf-field-group.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/build/css/acf-field-group.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/build/css/acf-field-group.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/build/css/acf-global.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/build/css/acf-global.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/build/css/acf-global.min.css

Large diffs are not rendered by default.

15 changes: 10 additions & 5 deletions assets/build/css/pro/acf-pro-input.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/build/css/pro/acf-pro-input.css.map

Large diffs are not rendered by default.

Loading

0 comments on commit 6edaf7e

Please sign in to comment.