Plugin Directory

Changeset 3053321


Ignore:
Timestamp:
03/18/2024 10:09:36 AM (2 years ago)
Author:
appfulapp
Message:

Fix Appful login notice on Appful menu page

Location:
appful-app
Files:
7 deleted
6 edited
321 copied

Legend:

Unmodified
Added
Removed
  • appful-app/tags/3.1.24/appful-app.php

    r3043568 r3053321  
    1212 * Plugin URI:        https://appful.io
    1313 * Description:       Appful® is the number 1 plugin for turning your WordPress Content into a native, beautiful app on iOS & Android in under 5 minutes.
    14  * Version:           3.1.23
     14 * Version:           3.1.24
    1515 * Requires at least: 5.8
    1616 * Requires PHP:      7.4
  • appful-app/tags/3.1.24/includes/api/mapper/BlogInfoMapper.php

    r3043568 r3053321  
    3232            $blog_info->get_token(),
    3333            $hooks,
    34             "3.1.23",
     34            "3.1.24",
    3535            $stats,
    3636            $settings
  • appful-app/tags/3.1.24/includes/main/AppfulPlugin.php

    r3043568 r3053321  
    4747        $this->configure_instance();
    4848
    49         $this->menu->register();
    50         $this->notice->register();
     49        $this->menu->register();
     50        $this->notice->register();
    5151
    52         $this->hooks->init();
     52        $this->hooks->init();
    5353        $this->api->init();
    5454
  • appful-app/tags/3.1.24/includes/notice/Notice.php

    r2907312 r3053321  
    77
    88class Notice {
    9     private IsLoggedInUseCase $is_logged_in_use_case;
     9    private IsLoggedInUseCase $is_logged_in_use_case;
    1010
    11     public function __construct( IsLoggedInUseCase $is_logged_in_use_case ) {
    12         $this->is_logged_in_use_case = $is_logged_in_use_case;
    13     }
     11    public function __construct( IsLoggedInUseCase $is_logged_in_use_case ) {
     12        $this->is_logged_in_use_case = $is_logged_in_use_case;
     13    }
    1414
    15     public function register(): void {
    16         if ( ! $this->is_logged_in_use_case->invoke() ) {
    17             add_action(
    18                 "admin_notices",
    19                 function () {
    20                     $this->register_notice();
    21                 },
    22                 10,
    23                 0
    24             );
    25         }
    26     }
     15    public function register(): void {
     16        if ( !$this->is_appful_menu_page() && !$this->is_logged_in_use_case->invoke() ) {
     17            add_action(
     18                "admin_notices",
     19                function () {
     20                    $this->register_notice();
     21                },
     22                10,
     23                0
     24            );
     25        }
     26    }
    2727
    28     private function register_notice(): void {
    29         $template_loader = new TemplateLoader();
    30         echo( $template_loader->load_template(
    31             "appful_notice.html.twig",
    32             [
    33                 "appful_page_link" => $this->build_url()
    34             ]
    35         ) );
    36     }
     28    private function is_appful_menu_page(): bool {
     29        global $pagenow;
     30        return $pagenow === "admin.php" && isset( $_GET["page"] ) && $_GET["page"] === "appful_menu";
     31    }
    3732
    38     private function build_url(): string {
    39         return esc_url(
    40             add_query_arg(
    41                 "page",
    42                 "appful_menu",
    43                 get_admin_url() . "admin.php"
    44             )
    45         );
    46     }
     33    private function register_notice(): void {
     34        $template_loader = new TemplateLoader();
     35        echo($template_loader->load_template(
     36            "appful_notice.html.twig",
     37            [
     38                "appful_page_link" => $this->build_url()
     39            ]
     40        ));
     41    }
     42
     43    private function build_url(): string {
     44        return esc_url(
     45            add_query_arg(
     46                "page",
     47                "appful_menu",
     48                get_admin_url() . "admin.php"
     49            )
     50        );
     51    }
    4752}
  • appful-app/tags/3.1.24/readme.txt

    r3043568 r3053321  
    66Tested up to: 6.4
    77Requires PHP: 7.4
    8 Stable tag: 3.1.23
     8Stable tag: 3.1.24
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • appful-app/trunk/appful-app.php

    r3043568 r3053321  
    1212 * Plugin URI:        https://appful.io
    1313 * Description:       Appful® is the number 1 plugin for turning your WordPress Content into a native, beautiful app on iOS & Android in under 5 minutes.
    14  * Version:           3.1.23
     14 * Version:           3.1.24
    1515 * Requires at least: 5.8
    1616 * Requires PHP:      7.4
  • appful-app/trunk/includes/api/mapper/BlogInfoMapper.php

    r3043568 r3053321  
    3232            $blog_info->get_token(),
    3333            $hooks,
    34             "3.1.23",
     34            "3.1.24",
    3535            $stats,
    3636            $settings
  • appful-app/trunk/includes/main/AppfulPlugin.php

    r3043568 r3053321  
    4747        $this->configure_instance();
    4848
    49         $this->menu->register();
    50         $this->notice->register();
     49        $this->menu->register();
     50        $this->notice->register();
    5151
    52         $this->hooks->init();
     52        $this->hooks->init();
    5353        $this->api->init();
    5454
  • appful-app/trunk/includes/notice/Notice.php

    r2907312 r3053321  
    77
    88class Notice {
    9     private IsLoggedInUseCase $is_logged_in_use_case;
     9    private IsLoggedInUseCase $is_logged_in_use_case;
    1010
    11     public function __construct( IsLoggedInUseCase $is_logged_in_use_case ) {
    12         $this->is_logged_in_use_case = $is_logged_in_use_case;
    13     }
     11    public function __construct( IsLoggedInUseCase $is_logged_in_use_case ) {
     12        $this->is_logged_in_use_case = $is_logged_in_use_case;
     13    }
    1414
    15     public function register(): void {
    16         if ( ! $this->is_logged_in_use_case->invoke() ) {
    17             add_action(
    18                 "admin_notices",
    19                 function () {
    20                     $this->register_notice();
    21                 },
    22                 10,
    23                 0
    24             );
    25         }
    26     }
     15    public function register(): void {
     16        if ( !$this->is_appful_menu_page() && !$this->is_logged_in_use_case->invoke() ) {
     17            add_action(
     18                "admin_notices",
     19                function () {
     20                    $this->register_notice();
     21                },
     22                10,
     23                0
     24            );
     25        }
     26    }
    2727
    28     private function register_notice(): void {
    29         $template_loader = new TemplateLoader();
    30         echo( $template_loader->load_template(
    31             "appful_notice.html.twig",
    32             [
    33                 "appful_page_link" => $this->build_url()
    34             ]
    35         ) );
    36     }
     28    private function is_appful_menu_page(): bool {
     29        global $pagenow;
     30        return $pagenow === "admin.php" && isset( $_GET["page"] ) && $_GET["page"] === "appful_menu";
     31    }
    3732
    38     private function build_url(): string {
    39         return esc_url(
    40             add_query_arg(
    41                 "page",
    42                 "appful_menu",
    43                 get_admin_url() . "admin.php"
    44             )
    45         );
    46     }
     33    private function register_notice(): void {
     34        $template_loader = new TemplateLoader();
     35        echo($template_loader->load_template(
     36            "appful_notice.html.twig",
     37            [
     38                "appful_page_link" => $this->build_url()
     39            ]
     40        ));
     41    }
     42
     43    private function build_url(): string {
     44        return esc_url(
     45            add_query_arg(
     46                "page",
     47                "appful_menu",
     48                get_admin_url() . "admin.php"
     49            )
     50        );
     51    }
    4752}
  • appful-app/trunk/readme.txt

    r3043568 r3053321  
    66Tested up to: 6.4
    77Requires PHP: 7.4
    8 Stable tag: 3.1.23
     8Stable tag: 3.1.24
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.