Plugin Directory

Changeset 3762992


Ignore:
Timestamp:
10/24/2026 09:18:42 AM (2 hours ago)
Author:
itay12222
Message:

Release 1.15.23

Location:
marcelo-site-connector
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • marcelo-site-connector/tags/1.15.23/marcelo-site-connector.php

    r3756387 r3762992  
    33 * Plugin Name:       Marcelo Site Connector
    44 * Description:       Lets Marcelo add the verification and measurement tags a site needs — Search Console, Analytics, Tag Manager, the Google Ads conversion tag — send addresses that no longer exist to the page that replaced them, give a page the search-result description it is missing, give a page the search-result title it is missing or is sharing with another page, edit the text of a page built with Elementor, put a tap-to-call bar in front of visitors, link the profiles a business has confirmed are theirs from every page, say on every page that a business answers around the clock where its confirmed hours say exactly that, let a named crawler back in where robots.txt was turning it away, point a page's canonical back at itself where it names another website, add a translated page's own link among its hreflang alternates where it is missing, and shrink an oversized image in the site's own media library while keeping its original, without anyone editing theme files by hand.
    5  * Version:           1.15.22
     5 * Version:           1.15.23
    66 * Requires at least: 6.0
    77 * Requires PHP:      7.4
    … …  
    123123 */
    124124const MARCELO_SC_HREFLANG_OPTION     = 'marcelo_site_connector_hreflang';
    125 const MARCELO_SC_VERSION             = '1.15.22';
     125const MARCELO_SC_VERSION             = '1.15.23';
    126126
    127127/**
    … …  
    554554 */
    555555function marcelo_sc_features(): array {
    556         return array( 'snippets', 'redirects', 'schema', 'descriptions', 'titles', 'elementor', 'call-bar', 'tap-size', 'tap-size-merge', 'robots', 'canonicals', 'google-ads', 'image-compress', 'profile-links', 'profile-links-appearance', 'menu-entries', 'availability-notice', 'hreflang-self', 'menu-shapes', 'index-pages', 'mail-health', 'llms', 'enquiry-form', 'render-preview', 'page-phone', 'page-search', 'article-post', 'update-self' );
     556        return array( 'snippets', 'redirects', 'schema', 'descriptions', 'titles', 'elementor', 'call-bar', 'tap-size', 'tap-size-merge', 'robots', 'canonicals', 'google-ads', 'image-compress', 'profile-links', 'profile-links-appearance', 'menu-entries', 'availability-notice', 'hreflang-self', 'menu-shapes', 'index-pages', 'cache-purge', 'mail-health', 'llms', 'enquiry-form', 'render-preview', 'page-phone', 'page-search', 'article-post', 'update-self' );
    557557}
    558558
    … …  
    60136013                        'callback'            => 'marcelo_sc_rest_get_mail_health',
    60146014                        'permission_callback' => 'marcelo_sc_can_manage',
     6015                )
     6016        );
     6017
     6018        /**
     6019         * The site's page caches cleared on request — after Marcelo writes to
     6020         * the site's own menu through WordPress's routes, which tell no cache
     6021         * plugin and no host cache: universalhvaclosangeles.com, 20 October 2026,
     6022         * served its home page with the old menu for half an hour after four city
     6023         * pages had joined it. Named 'cache-purge' in the feature list.
     6024         */
     6025        register_rest_route(
     6026                'marcelo/v1',
     6027                '/cache-purge',
     6028                array(
     6029                        array(
     6030                                'methods'             => 'POST',
     6031                                'callback'            => 'marcelo_sc_rest_purge_caches',
     6032                                'permission_callback' => 'marcelo_sc_can_manage',
     6033                        ),
    60156034                )
    60166035        );
    … …  
    88508869
    88518870/**
     8871 * Clears every page cache the site runs (`marcelo_sc_purge_page_caches`), and
     8872 * nothing else: no setting of the site's own is read or written. Asked after
     8873 * a write to WordPress's own menu, which the caches are never told about.
     8874 */
     8875function marcelo_sc_rest_purge_caches(): WP_REST_Response {
     8876        marcelo_sc_purge_page_caches();
     8877
     8878        return new WP_REST_Response( array( 'purged' => true ), 200 );
     8879}
     8880
     8881/**
    88528882 * What this site's robots.txt is, where it comes from, and what is in it.
    88538883 *
    … …  
    1077310803 * every other site the moment this file is read.
    1077410804 *
    10775  * `parse_content` is the real one's two steps minus its `post/parse` action.
     10805 * `parse_content` is the real one's steps minus its `post/parse` action.
    1077610806 * The action's listeners — the page's own settings, a page's custom CSS —
    1077710807 * resolve the page through its document, and a post with no id has none to
    … …  
    1079810828                }
    1079910829
     10830                /**
     10831                 * Elementor's own parse, step for step, minus its `post/parse` action.
     10832                 *
     10833                 * Measured 24 October 2026 on sosrestorationofsanfrancisco.com: the
     10834                 * preview of a FAQ block on the home page drew every heading of the
     10835                 * page in the kit's default light blue, at the theme's size, off
     10836                 * centre, while the header and footer templates beside it were right.
     10837                 * Elementor 4.x keeps a front-end request's style controls — every
     10838                 * colour, size and alignment an element has — apart from its other
     10839                 * controls (`Performance::should_optimize_controls`), and counts them
     10840                 * only while `Performance::set_use_style_controls( true )` is on. Its
     10841                 * own parse turns it on; this one did not, so each element's rules
     10842                 * came out empty. The templates' CSS goes through Elementor's own
     10843                 * parse, which is why only the page's own elements lost theirs.
     10844                 */
    1080010845                protected function parse_content() {
    10801                         $this->render_css();
    10802                         return $this->get_stylesheet()->__toString();
     10846                        $performance = '\Elementor\Core\Frontend\Performance';
     10847                        $styles      = class_exists( $performance ) && method_exists( $performance, 'set_use_style_controls' );
     10848                        $breakpoints = \Elementor\Plugin::$instance->breakpoints ?? null;
     10849                        $duplicates  = is_object( $breakpoints )
     10850                                && method_exists( $breakpoints, 'get_responsive_control_duplication_mode' )
     10851                                && method_exists( $breakpoints, 'set_responsive_control_duplication_mode' )
     10852                                && method_exists( $this, 'get_responsive_control_duplication_mode' );
     10853                        $initial     = $duplicates ? $breakpoints->get_responsive_control_duplication_mode() : null;
     10854
     10855                        if ( $styles ) {
     10856                                $performance::set_use_style_controls( true );
     10857                        }
     10858                        if ( $duplicates ) {
     10859                                $breakpoints->set_responsive_control_duplication_mode( $this->get_responsive_control_duplication_mode() );
     10860                        }
     10861                        try {
     10862                                $this->render_css();
     10863                                $css = (string) $this->get_stylesheet()->__toString();
     10864                        } finally {
     10865                                if ( $duplicates ) {
     10866                                        $breakpoints->set_responsive_control_duplication_mode( $initial );
     10867                                }
     10868                                if ( $styles ) {
     10869                                        $performance::set_use_style_controls( false );
     10870                                }
     10871                        }
     10872
     10873                        // Elementor's own last step (a private method, so repeated here):
     10874                        // a value carrying `</style` cannot close the tag it is printed in.
     10875                        $sanitized = preg_replace( '/<\/(style)/i', '<\\\\/$1', $css );
     10876                        return is_string( $sanitized ) ? $sanitized : $css;
    1080310877                }
    1080410878
    … …  
    1378813862                                preg_split( '/\s+/', trim( $found[3] ) ),
    1378913863                                static function ( string $name ): bool {
    13790                                         return '' !== $name && 1 !== preg_match( '/^(?:menu-item-has-children|page_item_has_children|has-children|has-dropdown|dropdown|has-submenu|has-sub|menu-item-has-mega-menu|sos-tiene-sub)$/i', $name );
     13864                                        return '' !== $name && 1 !== preg_match( '/^(?:menu-item-has-children|page_item_has_children|has-children|has-dropdown|dropdown|has-submenu|has-sub|menu-item-has-mega-menu|sos-tiene-sub|elementskit-dropdown-has|elementskit-megamenu-has)$/i', $name );
     13865                                }
     13866                        );
     13867                        return $found[1] . $found[2] . implode( ' ', $kept ) . $found[2];
     13868                },
     13869                (string) $head
     13870        );
     13871        // A toggle class on the link itself (ElementsKit's `ekit-menu-dropdown-toggle`).
     13872        $head = preg_replace_callback(
     13873                '/(<a\b[^>]*?\sclass\s*=\s*)(["\'])(.*?)\2/is',
     13874                static function ( array $found ): string {
     13875                        $kept = array_filter(
     13876                                preg_split( '/\s+/', trim( $found[3] ) ),
     13877                                static function ( string $name ): bool {
     13878                                        return '' !== $name && 1 !== preg_match( '/dropdown-toggle|submenu-toggle|menu-toggle$/i', $name );
    1379113879                                }
    1379213880                        );
  • marcelo-site-connector/tags/1.15.23/readme.txt

    r3756387 r3762992  
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 1.15.22
     7Stable tag: 1.15.23
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    114114== Changelog ==
    115115
     116= 1.15.23 =
     117* A private preview of a change to an existing Elementor page keeps that page's own element styles: headings keep their colour, size and alignment instead of falling back to the site's default colour.
     118* After Marcelo writes to the site's own menu, the plugin clears the site's page caches, so visitors see the new menu straight away rather than an older copy.
     119* A home page whose theme shows no menu gets the site's header and menu inside the page Marcelo publishes.
     120
    116121= 1.15.22 =
    117122* The menu's Blog opens the site's blog page, with no dropdown of article titles. Services and Service Areas open their own page too, and past fifteen pages a dropdown shows its first six and a "See more" line. Nothing in the site's WordPress menus is changed or deleted; the shape is drawn over the menu visitors see, and taking it off in Marcelo puts the dropdown back.
  • marcelo-site-connector/trunk/marcelo-site-connector.php

    r3756387 r3762992  
    33 * Plugin Name:       Marcelo Site Connector
    44 * Description:       Lets Marcelo add the verification and measurement tags a site needs — Search Console, Analytics, Tag Manager, the Google Ads conversion tag — send addresses that no longer exist to the page that replaced them, give a page the search-result description it is missing, give a page the search-result title it is missing or is sharing with another page, edit the text of a page built with Elementor, put a tap-to-call bar in front of visitors, link the profiles a business has confirmed are theirs from every page, say on every page that a business answers around the clock where its confirmed hours say exactly that, let a named crawler back in where robots.txt was turning it away, point a page's canonical back at itself where it names another website, add a translated page's own link among its hreflang alternates where it is missing, and shrink an oversized image in the site's own media library while keeping its original, without anyone editing theme files by hand.
    5  * Version:           1.15.22
     5 * Version:           1.15.23
    66 * Requires at least: 6.0
    77 * Requires PHP:      7.4
    … …  
    123123 */
    124124const MARCELO_SC_HREFLANG_OPTION     = 'marcelo_site_connector_hreflang';
    125 const MARCELO_SC_VERSION             = '1.15.22';
     125const MARCELO_SC_VERSION             = '1.15.23';
    126126
    127127/**
    … …  
    554554 */
    555555function marcelo_sc_features(): array {
    556         return array( 'snippets', 'redirects', 'schema', 'descriptions', 'titles', 'elementor', 'call-bar', 'tap-size', 'tap-size-merge', 'robots', 'canonicals', 'google-ads', 'image-compress', 'profile-links', 'profile-links-appearance', 'menu-entries', 'availability-notice', 'hreflang-self', 'menu-shapes', 'index-pages', 'mail-health', 'llms', 'enquiry-form', 'render-preview', 'page-phone', 'page-search', 'article-post', 'update-self' );
     556        return array( 'snippets', 'redirects', 'schema', 'descriptions', 'titles', 'elementor', 'call-bar', 'tap-size', 'tap-size-merge', 'robots', 'canonicals', 'google-ads', 'image-compress', 'profile-links', 'profile-links-appearance', 'menu-entries', 'availability-notice', 'hreflang-self', 'menu-shapes', 'index-pages', 'cache-purge', 'mail-health', 'llms', 'enquiry-form', 'render-preview', 'page-phone', 'page-search', 'article-post', 'update-self' );
    557557}
    558558
    … …  
    60136013                        'callback'            => 'marcelo_sc_rest_get_mail_health',
    60146014                        'permission_callback' => 'marcelo_sc_can_manage',
     6015                )
     6016        );
     6017
     6018        /**
     6019         * The site's page caches cleared on request — after Marcelo writes to
     6020         * the site's own menu through WordPress's routes, which tell no cache
     6021         * plugin and no host cache: universalhvaclosangeles.com, 20 October 2026,
     6022         * served its home page with the old menu for half an hour after four city
     6023         * pages had joined it. Named 'cache-purge' in the feature list.
     6024         */
     6025        register_rest_route(
     6026                'marcelo/v1',
     6027                '/cache-purge',
     6028                array(
     6029                        array(
     6030                                'methods'             => 'POST',
     6031                                'callback'            => 'marcelo_sc_rest_purge_caches',
     6032                                'permission_callback' => 'marcelo_sc_can_manage',
     6033                        ),
    60156034                )
    60166035        );
    … …  
    88508869
    88518870/**
     8871 * Clears every page cache the site runs (`marcelo_sc_purge_page_caches`), and
     8872 * nothing else: no setting of the site's own is read or written. Asked after
     8873 * a write to WordPress's own menu, which the caches are never told about.
     8874 */
     8875function marcelo_sc_rest_purge_caches(): WP_REST_Response {
     8876        marcelo_sc_purge_page_caches();
     8877
     8878        return new WP_REST_Response( array( 'purged' => true ), 200 );
     8879}
     8880
     8881/**
    88528882 * What this site's robots.txt is, where it comes from, and what is in it.
    88538883 *
    … …  
    1077310803 * every other site the moment this file is read.
    1077410804 *
    10775  * `parse_content` is the real one's two steps minus its `post/parse` action.
     10805 * `parse_content` is the real one's steps minus its `post/parse` action.
    1077610806 * The action's listeners — the page's own settings, a page's custom CSS —
    1077710807 * resolve the page through its document, and a post with no id has none to
    … …  
    1079810828                }
    1079910829
     10830                /**
     10831                 * Elementor's own parse, step for step, minus its `post/parse` action.
     10832                 *
     10833                 * Measured 24 October 2026 on sosrestorationofsanfrancisco.com: the
     10834                 * preview of a FAQ block on the home page drew every heading of the
     10835                 * page in the kit's default light blue, at the theme's size, off
     10836                 * centre, while the header and footer templates beside it were right.
     10837                 * Elementor 4.x keeps a front-end request's style controls — every
     10838                 * colour, size and alignment an element has — apart from its other
     10839                 * controls (`Performance::should_optimize_controls`), and counts them
     10840                 * only while `Performance::set_use_style_controls( true )` is on. Its
     10841                 * own parse turns it on; this one did not, so each element's rules
     10842                 * came out empty. The templates' CSS goes through Elementor's own
     10843                 * parse, which is why only the page's own elements lost theirs.
     10844                 */
    1080010845                protected function parse_content() {
    10801                         $this->render_css();
    10802                         return $this->get_stylesheet()->__toString();
     10846                        $performance = '\Elementor\Core\Frontend\Performance';
     10847                        $styles      = class_exists( $performance ) && method_exists( $performance, 'set_use_style_controls' );
     10848                        $breakpoints = \Elementor\Plugin::$instance->breakpoints ?? null;
     10849                        $duplicates  = is_object( $breakpoints )
     10850                                && method_exists( $breakpoints, 'get_responsive_control_duplication_mode' )
     10851                                && method_exists( $breakpoints, 'set_responsive_control_duplication_mode' )
     10852                                && method_exists( $this, 'get_responsive_control_duplication_mode' );
     10853                        $initial     = $duplicates ? $breakpoints->get_responsive_control_duplication_mode() : null;
     10854
     10855                        if ( $styles ) {
     10856                                $performance::set_use_style_controls( true );
     10857                        }
     10858                        if ( $duplicates ) {
     10859                                $breakpoints->set_responsive_control_duplication_mode( $this->get_responsive_control_duplication_mode() );
     10860                        }
     10861                        try {
     10862                                $this->render_css();
     10863                                $css = (string) $this->get_stylesheet()->__toString();
     10864                        } finally {
     10865                                if ( $duplicates ) {
     10866                                        $breakpoints->set_responsive_control_duplication_mode( $initial );
     10867                                }
     10868                                if ( $styles ) {
     10869                                        $performance::set_use_style_controls( false );
     10870                                }
     10871                        }
     10872
     10873                        // Elementor's own last step (a private method, so repeated here):
     10874                        // a value carrying `</style` cannot close the tag it is printed in.
     10875                        $sanitized = preg_replace( '/<\/(style)/i', '<\\\\/$1', $css );
     10876                        return is_string( $sanitized ) ? $sanitized : $css;
    1080310877                }
    1080410878
    … …  
    1378813862                                preg_split( '/\s+/', trim( $found[3] ) ),
    1378913863                                static function ( string $name ): bool {
    13790                                         return '' !== $name && 1 !== preg_match( '/^(?:menu-item-has-children|page_item_has_children|has-children|has-dropdown|dropdown|has-submenu|has-sub|menu-item-has-mega-menu|sos-tiene-sub)$/i', $name );
     13864                                        return '' !== $name && 1 !== preg_match( '/^(?:menu-item-has-children|page_item_has_children|has-children|has-dropdown|dropdown|has-submenu|has-sub|menu-item-has-mega-menu|sos-tiene-sub|elementskit-dropdown-has|elementskit-megamenu-has)$/i', $name );
     13865                                }
     13866                        );
     13867                        return $found[1] . $found[2] . implode( ' ', $kept ) . $found[2];
     13868                },
     13869                (string) $head
     13870        );
     13871        // A toggle class on the link itself (ElementsKit's `ekit-menu-dropdown-toggle`).
     13872        $head = preg_replace_callback(
     13873                '/(<a\b[^>]*?\sclass\s*=\s*)(["\'])(.*?)\2/is',
     13874                static function ( array $found ): string {
     13875                        $kept = array_filter(
     13876                                preg_split( '/\s+/', trim( $found[3] ) ),
     13877                                static function ( string $name ): bool {
     13878                                        return '' !== $name && 1 !== preg_match( '/dropdown-toggle|submenu-toggle|menu-toggle$/i', $name );
    1379113879                                }
    1379213880                        );
  • marcelo-site-connector/trunk/readme.txt

    r3756387 r3762992  
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 1.15.22
     7Stable tag: 1.15.23
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    114114== Changelog ==
    115115
     116= 1.15.23 =
     117* A private preview of a change to an existing Elementor page keeps that page's own element styles: headings keep their colour, size and alignment instead of falling back to the site's default colour.
     118* After Marcelo writes to the site's own menu, the plugin clears the site's page caches, so visitors see the new menu straight away rather than an older copy.
     119* A home page whose theme shows no menu gets the site's header and menu inside the page Marcelo publishes.
     120
    116121= 1.15.22 =
    117122* The menu's Blog opens the site's blog page, with no dropdown of article titles. Services and Service Areas open their own page too, and past fifteen pages a dropdown shows its first six and a "See more" line. Nothing in the site's WordPress menus is changed or deleted; the shape is drawn over the menu visitors see, and taking it off in Marcelo puts the dropdown back.
Note: See TracChangeset for help on using the changeset viewer.