diff --git a/pattern-wrangler.php b/pattern-wrangler.php index 96c430e..a1a375d 100644 --- a/pattern-wrangler.php +++ b/pattern-wrangler.php @@ -20,7 +20,7 @@ define( 'DLX_PATTERN_WRANGLER_VERSION', '1.0.0' ); define( 'DLX_PATTERN_WRANGLER_FILE', __FILE__ ); -define( 'DLX_PATTERN_WRANGLER_PRODUCT_ID', 36631 ); +define( 'DLX_PATTERN_WRANGLER_PRODUCT_ID', 37029 ); // Support for site-level autoloading. if ( file_exists( __DIR__ . '/lib/autoload.php' ) ) { diff --git a/php/Admin.php b/php/Admin.php index 2c92c9e..67c00e4 100644 --- a/php/Admin.php +++ b/php/Admin.php @@ -167,7 +167,7 @@ public function ajax_save_license() { // Get latest options. $options = Options::get_options( true ); $options['licenseKey'] = $license_key; - $options['licenseData'] = get_site_transient( 'dlxgbhacks_core_license_check', array() ); + $options['licenseData'] = get_site_transient( 'dlxpw_core_license_check', array() ); wp_send_json_success( $options ); } @@ -218,7 +218,7 @@ public function ajax_license_get_options() { ); } $options = Options::get_options( true ); - $options['licenseData'] = get_site_transient( 'dlxgbhacks_core_license_check', array() ); + $options['licenseData'] = get_site_transient( 'dlxpw_core_license_check', array() ); wp_send_json_success( $options ); } diff --git a/php/Patterns.php b/php/Patterns.php index d3144c8..156944f 100644 --- a/php/Patterns.php +++ b/php/Patterns.php @@ -42,6 +42,9 @@ public function run() { // Add a featured image to the wp_block post type. add_action( 'init', array( $this, 'add_featured_image_support' ) ); + // Add an author to the wp_block post type. + add_action( 'init', array( $this, 'add_post_author_support' ) ); + // Change post type label for featured image. add_filter( 'post_type_labels_wp_block', array( $this, 'change_featured_image_label' ) ); @@ -190,6 +193,13 @@ public function add_featured_image_support() { add_post_type_support( 'wp_block', 'thumbnail' ); } + /** + * Add post author support to wp_block post type. + */ + public function add_post_author_support() { + add_post_type_support( 'wp_block', 'author' ); + } + /** * Remove core patterns. */ diff --git a/php/Plugin_License.php b/php/Plugin_License.php index 909babc..ac06d91 100644 --- a/php/Plugin_License.php +++ b/php/Plugin_License.php @@ -79,7 +79,7 @@ public function perform_action( string $action, string $license = '', bool $forc private function perform_license_action( string $action, bool $force ) { $options = Options::get_options(); - $maybe_check = get_site_transient( 'dlxgbhacks_core_license_check' ); + $maybe_check = get_site_transient( 'dlxpw_core_license_check' ); if ( 'check_license' === $action && ! $force && $maybe_check ) { return $maybe_check; @@ -91,7 +91,7 @@ private function perform_license_action( string $action, bool $force ) { 'license_errors' => true, 'license' => $this->license, 'license_valid' => false, - 'message' => __( 'It appears the license key is blank.', 'dlx-gb-hacks' ), + 'message' => __( 'It appears the license key is blank.', 'dlx-pattern-wrangler' ), 'data' => array(), 'action' => $action, ); @@ -102,7 +102,7 @@ private function perform_license_action( string $action, bool $force ) { $api_params = array( 'edd_action' => $action, 'license' => $this->license, - 'item_id' => GB_HACKS_PRODUCT_ID, + 'item_id' => DLX_PATTERN_WRANGLER_PRODUCT_ID, 'url' => home_url(), ); // Call the custom API. @@ -120,7 +120,7 @@ private function perform_license_action( string $action, bool $force ) { return $response; } if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { - return new \WP_Error( 'sce_license_communications_error', __( 'We could not communicate with the update server. Please try again later.', 'dlx-gb-hacks' ) ); + return new \WP_Error( 'sce_license_communications_error', __( 'We could not communicate with the update server. Please try again later.', 'dlx-pattern-wrangler' ) ); } // Succeeded, let's check the response. $response = $this->get_response( json_decode( wp_remote_retrieve_body( $response ), ARRAY_A ), $action ); @@ -155,7 +155,7 @@ private function perform_license_action( string $action, bool $force ) { // Add query flag for checking the license so we don't ping the API every time. if ( 'check_license' === $action || 'activate_license' === $action ) { - set_site_transient( 'dlxgbhacks_core_license_check', $response, 12 * HOUR_IN_SECONDS ); + set_site_transient( 'dlxpw_core_license_check', $response, 12 * HOUR_IN_SECONDS ); } /** @@ -166,10 +166,10 @@ private function perform_license_action( string $action, bool $force ) { * @param string $action Can be: check_license, activate_license, deactivate_license * @param array $response Response of the action. */ - do_action( 'dlx_gb_hacks_core_license_' . $action, $response ); + do_action( 'dlx_pw_core_license_' . $action, $response ); // Return any custom data. - $data = apply_filters( 'dlx_gb_hacks_core_license_data_' . $action, $response ); + $data = apply_filters( 'dlx_pw_core_license_data_' . $action, $response ); return $data; } @@ -214,8 +214,8 @@ private function get_response( array $response, string $action ) { if ( ! empty( $expires ) ) { if ( 'lifetime' === $expires ) { - $return_defaults['expires_human_time_diff'] = esc_html__( 'Lifetime', 'dlx-gb-hacks' ); - $return_defaults['expires'] = esc_html__( 'Lifetime', 'dlx-gb-hacks' ); + $return_defaults['expires_human_time_diff'] = esc_html__( 'Lifetime', 'dlx-pattern-wrangler' ); + $return_defaults['expires'] = esc_html__( 'Lifetime', 'dlx-pattern-wrangler' ); } else { $return_defaults['expires_human_time_diff'] = human_time_diff( time(), strtotime( $expires ) ); $return_defaults['expires'] = date_i18n( 'F jS, Y', strtotime( $expires ) ); @@ -226,7 +226,7 @@ private function get_response( array $response, string $action ) { if ( 'deactivate_license' === $action ) { return wp_parse_args( array( - 'message' => __( 'Your license key has been deactivated.', 'dlx-gb-hacks' ), + 'message' => __( 'Your license key has been deactivated.', 'dlx-pattern-wrangler' ), ), $return_defaults ); @@ -234,7 +234,7 @@ private function get_response( array $response, string $action ) { if ( 'activate_license' === $action || 'check_license' === $action ) { return wp_parse_args( array( - 'message' => __( 'Your license key is active and valid.', 'dlx-gb-hacks' ), + 'message' => __( 'Your license key is active and valid.', 'dlx-pattern-wrangler' ), ), $return_defaults ); @@ -242,38 +242,38 @@ private function get_response( array $response, string $action ) { } // There are errors. - $error_message = __( 'An error occurred, please try again.', 'dlx-gb-hacks' ); + $error_message = __( 'An error occurred, please try again.', 'dlx-pattern-wrangler' ); $errors = $response['error'] ?? false; if ( $errors ) { switch ( $errors ) { case 'expired': $error_message = sprintf( /* Translators: %s is a date format placeholder */ - __( 'Your license key expired on %s.', 'dlx-gb-hacks' ), + __( 'Your license key expired on %s.', 'dlx-pattern-wrangler' ), date_i18n( get_option( 'date_format' ), strtotime( $response['expires'], current_time( 'timestamp' ) ) ) // phpcs:ignore ); break; case 'disabled': case 'revoked': - $error_message = __( 'Your license key has been disabled.', 'dlx-gb-hacks' ); + $error_message = __( 'Your license key has been disabled.', 'dlx-pattern-wrangler' ); break; case 'missing': - $error_message = __( 'The license entered is not valid.', 'dlx-gb-hacks' ); + $error_message = __( 'The license entered is not valid.', 'dlx-pattern-wrangler' ); break; case 'invalid': case 'site_inactive': - $error_message = __( 'Your license is not active for this URL.', 'dlx-gb-hacks' ); + $error_message = __( 'Your license is not active for this URL.', 'dlx-pattern-wrangler' ); break; case 'item_name_mismatch': /* Translators: %s is the plugin name */ - $error_message = sprintf( __( 'This appears to be an invalid license key for %s.', 'dlx-gb-hacks' ), 'Toggl Plan for Gravity Forms' ); + $error_message = sprintf( __( 'This appears to be an invalid license key for %s.', 'dlx-pattern-wrangler' ), 'Toggl Plan for Gravity Forms' ); break; case 'no_activations_left': - $error_message = __( 'Your license key has reached its activation limit.', 'dlx-gb-hacks' ); + $error_message = __( 'Your license key has reached its activation limit.', 'dlx-pattern-wrangler' ); break; } } diff --git a/src/js/blocks/commands/index.js b/src/js/blocks/commands/index.js index cd1a821..8602979 100644 --- a/src/js/blocks/commands/index.js +++ b/src/js/blocks/commands/index.js @@ -43,11 +43,11 @@ const GBCommands = () => { context: 'block-editor', } ); useCommand( { - name: 'dlx-gb-hacks-Settings', + name: 'dlx-pattern-wrangler-Settings', label: 'Go to GenerateBlocks (GB) Hacks Settings', icon: settings, callback: () => { - document.location.href = 'admin.php?page=dlx-gb-hacks'; + document.location.href = 'admin.php?page=dlx-pattern-wrangler'; }, context: 'block-editor', } ); diff --git a/src/scss/admin.scss b/src/scss/admin.scss index 4a7c610..b0cf892 100644 --- a/src/scss/admin.scss +++ b/src/scss/admin.scss @@ -173,6 +173,20 @@ html { scroll-behavior: smooth; } +/* Lucide React Icons Styles */ +svg.lucide { + color: inherit; + fill: none !important; + + path, + circle, + rect, + line { + fill: unset !important; + color: currentColor !important; + } +} + /* Table Styles when rows are sections */ .form-table-row-sections { tr { @@ -498,9 +512,12 @@ html { border-left-color: var(--dlx-pw-admin--color-notice--warning-alt); } - svg path { + svg:not(.lucide) path { fill: var(--dlx-pw-admin--color-notice--warning-alt); } + svg.lucide { + color: var(--dlx-pw-admin--color-notice--warning-alt); + } } }