Plugin Directory

Changeset 2676816

Timestamp:
02/11/2022 02:55:23 AM (2 years ago)
Author:
manfcarlo
Message:

v1.3.1

Location:
wp-funnel-manager
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • wp-funnel-manager/tags/1.3.1/readme.txt

    r2569689 r2676816  
    11=== WP Funnel Manager ===
    22Contributors: manfcarlo
    3 Tags: funnel, funnels, marketing, sales
    4 Requires at least: 5.8
    5 Tested up to: 5.8
    6 Stable tag: 1.3.0
    7 Requires PHP: 5.6
     3Tags: funnel builder, page builder, sales funnels, landing page, marketing, sales, block, blocks, block editor, gutenberg, template, templates
     4Tested up to: 5.9
     5Stable tag: 1.3.1
    86License: GPLv2 or later
    97License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    4947Just go to the Funnels screen, find your funnel and click on Trash. This will delete the first step of the funnel only, and the second step of the funnel will take its place.
    5048
     49
     50
     51
     52
     53
     54
     55
     56
     57
     58
    5159= How do I suggest a new feature or submit a bug report? =
    5260
     
    5462
    5563== Changelog ==
     64
     65
     66
     67
     68
    5669
    5770= 1.3.0 =
  • wp-funnel-manager/tags/1.3.1/src/plugin.php

    r2569689 r2676816  
    2222     * @var bool
    2323     */
    24     private $is_legacy = false;
     24    private $is_legacy = true;
     25
     26    /**
     27     * Whether this plugin manages the templated funnel types.
     28     *
     29     * @since 1.3.1
     30     * @var bool
     31     */
     32    private $is_templated = false;
    2533
    2634    /**
     
    3240    private $funnel_types = array();
    3341
    34     /**
    35      * Instantiate a WP_Funnel_Manager object.
    36      *
    37      * Don't call the constructor directly, use the `WP_Funnel_Manager::get_instance()`
    38      * static method instead.
    39      */
    40     public function __construct()
    41     {
    42         add_theme_support( 'block-templates' );
    43     }
    44 
    4542    public function is_legacy()
    4643    {
     
    5047    public function register_funnel_types()
    5148    {
    52         if ( !get_option( 'wpfunnel_ignore_legacy' ) )
    53         {
    54             if ( empty( ( new \WP_Query( 'posts_per_page=-1&post_type=funnel&post_status=any,trash' ) )->posts ) )
     49        if ( get_option( 'wpfunnel_ignore_legacy' ) )
     50        {
     51            $this->is_legacy = false;
     52        }
     53
     54        $this->is_templated = current_theme_supports( 'block-templates' );
     55
     56        if ( $this->is_templated )
     57        {
     58            if ( $this->is_legacy && empty( (
     59                new \WP_Query(
     60                    array(
     61                        'post_type' => 'funnel',
     62                        'post_status' => array( 'any', 'trash' ),
     63                        'posts_per_page' => -1
     64                    )
     65                )
     66            )->posts ) )
    5567            {
    5668                update_option( 'wpfunnel_ignore_legacy', '1' );
     69
    5770            }
    58             else
     71
     72            foreach ( (
     73                new \WP_Query(
     74                    array(
     75                        'post_type' => 'wp_template',
     76                        'post_status' => 'publish',
     77                        'meta_key' => 'wpfunnel',
     78                        'meta_value' => '1',
     79                        'posts_per_page' => -1,
     80                        'orderby' => 'title',
     81                        'order' => 'ASC'
     82                    )
     83                )
     84            )->posts as $post )
    5985            {
    60                 $this->is_legacy = true;
     86                if ( strpos( $post->post_name, 'single-' ) === 0 )
     87                {
     88                    $slug = substr( $post->post_name, 7 );
     89
     90                    if ( ( !$this->is_legacy || $slug !== 'funnel' ) && substr( $slug, -4 ) !== '_int' )
     91                    {
     92                        $this->funnel_types[] = new Funnel_Type( $slug, $post );
     93                    }
     94                }
    6195            }
    6296        }
     
    67101        }
    68102
    69         foreach ( ( new \WP_Query( 'posts_per_page=-1&post_type=wp_template' ) )->posts as $post )
    70         {
    71             if ( empty( get_post_meta( $post->ID, 'wpfunnel' ) ) )
    72             continue;
    73 
    74             if ( $post->post_status !== 'publish' )
    75             continue;
    76 
    77             if ( strpos( $post->post_name, 'single-' ) !== 0 )
    78             continue;
    79 
    80             else
    81             $slug = substr( $post->post_name, 7 );
    82 
    83             if ( $this->is_legacy && $slug === 'funnel' )
    84             continue;
    85 
    86             if ( substr( $slug, -4 ) === '_int' )
    87             continue;
    88 
    89             $this->funnel_types[] = new Funnel_Type( $slug, $post );
    90         }
    91 
    92103        foreach ( $this->funnel_types as $type )
    93104        {
     
    98109    public function menu()
    99110    {
    100         $new_type = 'wpfunnel';
    101         $parent = $this->is_legacy ? 'edit.php?post_type=funnel' : $new_type;
    102 
    103         $wp_template = get_post_type_object( 'wp_template' );
    104         $new_type_capability = $wp_template === null ? 'do_not_allow' : $wp_template->cap->create_posts;
    105         $parent_capability = $this->is_legacy ? 'edit_posts' : $new_type_capability;
    106 
    107         add_menu_page( 'Funnels', 'Funnels', $parent_capability, $parent, '', 'dashicons-filter', 25 );
    108         $hook_suffix = add_submenu_page( $parent, 'New Funnel Type', 'New Funnel Type', $new_type_capability, $new_type, array( $this, 'new_funnel_type' ), 20 );
    109 
    110         add_action( 'load-' . $hook_suffix, array( $this, 'new_funnel_type' ) );
     111        if ( $this->is_templated || $this->is_legacy )
     112        {
     113            $new_type = 'wpfunnel';
     114            $parent = $this->is_legacy ? 'edit.php?post_type=funnel' : $new_type;
     115
     116            $wp_template = get_post_type_object( 'wp_template' );
     117            $new_type_capability = $wp_template === null ? 'do_not_allow' : $wp_template->cap->create_posts;
     118            $parent_capability = $this->is_legacy ? 'edit_posts' : $new_type_capability;
     119
     120            add_menu_page( 'Funnels', 'Funnels', $parent_capability, $parent, '', 'dashicons-filter', 25 );
     121
     122            if ( $this->is_templated )
     123            {
     124                $hook_suffix = add_submenu_page( $parent, 'New Funnel Type', 'New Funnel Type', $new_type_capability, $new_type, array( $this, 'new_funnel_type' ), 20 );
     125                add_action( 'load-' . $hook_suffix, array( $this, 'new_funnel_type' ) );
     126            }
     127        }
    111128    }
    112129
     
    165182        add_action( 'admin_menu', array( $this, 'menu' ), 9 );
    166183        add_action( 'init', array( $this, 'database_upgrade_130' ), 20 );
    167         add_action( 'plugins_loaded', array( $this, 'register_funnel_types' ) );
     184        add_action( 'init', array( $this, 'database_upgrade_131' ), 20 );
     185        add_action( 'after_setup_theme', array( $this, 'register_funnel_types' ) );
    168186    }
    169187
     
    182200                'post_type' => 'wp_template',
    183201                'post_status' => array( 'any', 'trash', 'auto-draft' ),
    184                 'meta_input' => array(
    185                     'wpfunnel' => '1'
     202                'meta_key' => 'wpfunnel',
     203                'meta_value' => '1',
     204                'posts_per_page' => -1
     205            )
     206        );
     207
     208        foreach ( $funnel_types->posts as $post )
     209        {
     210            wp_set_post_terms( $post->ID, array(), 'wp_theme' );
     211        }
     212
     213        // If upgrading to 130 on version 1.3.1, skip the upgrade to 131
     214        update_option( 'wpfunnel_db_version', '131' );
     215    }
     216
     217    /**
     218     * Fixes a now-removed error with the 130 upgrade routine.
     219     *
     220     * @since 1.3.1
     221     */
     222    public function database_upgrade_131()
     223    {
     224        if ( $this->get_db_version() >= 131 || !current_theme_supports( 'block-templates' ) )
     225        return;
     226
     227        $not_funnel_types = new \WP_Query(
     228            array(
     229                'post_type' => 'wp_template',
     230                'post_status' => array( 'any', 'trash', 'auto-draft' ),
     231                'meta_query' => array(
     232                    'relation' => 'OR',
     233                    array(
     234                        'key' => 'wpfunnel',
     235                        'compare' => 'NOT EXISTS'
     236                    ),
     237                    array(
     238                        'key' => 'wpfunnel',
     239                        'value' => '1',
     240                        'compare' => '!='
     241                    )
     242                ),
     243                'tax_query' => array(
     244                    array(
     245                        'taxonomy' => 'wp_theme',
     246                        'operator' => 'NOT EXISTS'
     247                    )
    186248                ),
    187249                'posts_per_page' => -1
     
    189251        );
    190252
    191         foreach ( $funnel_types->posts as $post )
    192         {
    193             wp_set_post_terms( $post->ID, array(), 'wp_theme' );
    194         }
    195 
    196         update_option( 'wpfunnel_db_version', '130' );
     253        foreach ( $funnel_types->posts as $post )
     254        {
     255            wp_set_post_terms( $post->ID, );
     256        }
     257
     258        update_option( 'wpfunnel_db_version', '13' );
    197259    }
    198260
    199261    public function no_funnels_notice()
    200262    {
    201         if ( empty( $this->funnel_types ) )
    202         {
    203             echo '<div class="notice notice-warning"><p>Thank you for activating WP Funnel Manager! To start building funnels, just click on Funnels in the admin menu.</p></div>';
     263        if ( )
     264        {
     265            echo '<div class="notice notice-warning"><p>Thank you for </p></div>';
    204266        }
    205267    }
  • wp-funnel-manager/tags/1.3.1/wp-funnel-manager.php

    r2569689 r2676816  
    44 * Plugin URI:
    55 * Description: Organises content into multi-step funnels.
    6  * Version: 1.3.0
     6 * Version: 1.3.
    77 * Requires at least: 5.8
     8
    89 * Author: Ask Carlo
    910 * Author URI: https://askcarlo.com
  • wp-funnel-manager/trunk/readme.txt

    r2569689 r2676816  
    11=== WP Funnel Manager ===
    22Contributors: manfcarlo
    3 Tags: funnel, funnels, marketing, sales
    4 Requires at least: 5.8
    5 Tested up to: 5.8
    6 Stable tag: 1.3.0
    7 Requires PHP: 5.6
     3Tags: funnel builder, page builder, sales funnels, landing page, marketing, sales, block, blocks, block editor, gutenberg, template, templates
     4Tested up to: 5.9
     5Stable tag: 1.3.1
    86License: GPLv2 or later
    97License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    4947Just go to the Funnels screen, find your funnel and click on Trash. This will delete the first step of the funnel only, and the second step of the funnel will take its place.
    5048
     49
     50
     51
     52
     53
     54
     55
     56
     57
     58
    5159= How do I suggest a new feature or submit a bug report? =
    5260
     
    5462
    5563== Changelog ==
     64
     65
     66
     67
     68
    5669
    5770= 1.3.0 =
  • wp-funnel-manager/trunk/src/plugin.php

    r2569689 r2676816  
    2222     * @var bool
    2323     */
    24     private $is_legacy = false;
     24    private $is_legacy = true;
     25
     26    /**
     27     * Whether this plugin manages the templated funnel types.
     28     *
     29     * @since 1.3.1
     30     * @var bool
     31     */
     32    private $is_templated = false;
    2533
    2634    /**
     
    3240    private $funnel_types = array();
    3341
    34     /**
    35      * Instantiate a WP_Funnel_Manager object.
    36      *
    37      * Don't call the constructor directly, use the `WP_Funnel_Manager::get_instance()`
    38      * static method instead.
    39      */
    40     public function __construct()
    41     {
    42         add_theme_support( 'block-templates' );
    43     }
    44 
    4542    public function is_legacy()
    4643    {
     
    5047    public function register_funnel_types()
    5148    {
    52         if ( !get_option( 'wpfunnel_ignore_legacy' ) )
    53         {
    54             if ( empty( ( new \WP_Query( 'posts_per_page=-1&post_type=funnel&post_status=any,trash' ) )->posts ) )
     49        if ( get_option( 'wpfunnel_ignore_legacy' ) )
     50        {
     51            $this->is_legacy = false;
     52        }
     53
     54        $this->is_templated = current_theme_supports( 'block-templates' );
     55
     56        if ( $this->is_templated )
     57        {
     58            if ( $this->is_legacy && empty( (
     59                new \WP_Query(
     60                    array(
     61                        'post_type' => 'funnel',
     62                        'post_status' => array( 'any', 'trash' ),
     63                        'posts_per_page' => -1
     64                    )
     65                )
     66            )->posts ) )
    5567            {
    5668                update_option( 'wpfunnel_ignore_legacy', '1' );
     69
    5770            }
    58             else
     71
     72            foreach ( (
     73                new \WP_Query(
     74                    array(
     75                        'post_type' => 'wp_template',
     76                        'post_status' => 'publish',
     77                        'meta_key' => 'wpfunnel',
     78                        'meta_value' => '1',
     79                        'posts_per_page' => -1,
     80                        'orderby' => 'title',
     81                        'order' => 'ASC'
     82                    )
     83                )
     84            )->posts as $post )
    5985            {
    60                 $this->is_legacy = true;
     86                if ( strpos( $post->post_name, 'single-' ) === 0 )
     87                {
     88                    $slug = substr( $post->post_name, 7 );
     89
     90                    if ( ( !$this->is_legacy || $slug !== 'funnel' ) && substr( $slug, -4 ) !== '_int' )
     91                    {
     92                        $this->funnel_types[] = new Funnel_Type( $slug, $post );
     93                    }
     94                }
    6195            }
    6296        }
     
    67101        }
    68102
    69         foreach ( ( new \WP_Query( 'posts_per_page=-1&post_type=wp_template' ) )->posts as $post )
    70         {
    71             if ( empty( get_post_meta( $post->ID, 'wpfunnel' ) ) )
    72             continue;
    73 
    74             if ( $post->post_status !== 'publish' )
    75             continue;
    76 
    77             if ( strpos( $post->post_name, 'single-' ) !== 0 )
    78             continue;
    79 
    80             else
    81             $slug = substr( $post->post_name, 7 );
    82 
    83             if ( $this->is_legacy && $slug === 'funnel' )
    84             continue;
    85 
    86             if ( substr( $slug, -4 ) === '_int' )
    87             continue;
    88 
    89             $this->funnel_types[] = new Funnel_Type( $slug, $post );
    90         }
    91 
    92103        foreach ( $this->funnel_types as $type )
    93104        {
     
    98109    public function menu()
    99110    {
    100         $new_type = 'wpfunnel';
    101         $parent = $this->is_legacy ? 'edit.php?post_type=funnel' : $new_type;
    102 
    103         $wp_template = get_post_type_object( 'wp_template' );
    104         $new_type_capability = $wp_template === null ? 'do_not_allow' : $wp_template->cap->create_posts;
    105         $parent_capability = $this->is_legacy ? 'edit_posts' : $new_type_capability;
    106 
    107         add_menu_page( 'Funnels', 'Funnels', $parent_capability, $parent, '', 'dashicons-filter', 25 );
    108         $hook_suffix = add_submenu_page( $parent, 'New Funnel Type', 'New Funnel Type', $new_type_capability, $new_type, array( $this, 'new_funnel_type' ), 20 );
    109 
    110         add_action( 'load-' . $hook_suffix, array( $this, 'new_funnel_type' ) );
     111        if ( $this->is_templated || $this->is_legacy )
     112        {
     113            $new_type = 'wpfunnel';
     114            $parent = $this->is_legacy ? 'edit.php?post_type=funnel' : $new_type;
     115
     116            $wp_template = get_post_type_object( 'wp_template' );
     117            $new_type_capability = $wp_template === null ? 'do_not_allow' : $wp_template->cap->create_posts;
     118            $parent_capability = $this->is_legacy ? 'edit_posts' : $new_type_capability;
     119
     120            add_menu_page( 'Funnels', 'Funnels', $parent_capability, $parent, '', 'dashicons-filter', 25 );
     121
     122            if ( $this->is_templated )
     123            {
     124                $hook_suffix = add_submenu_page( $parent, 'New Funnel Type', 'New Funnel Type', $new_type_capability, $new_type, array( $this, 'new_funnel_type' ), 20 );
     125                add_action( 'load-' . $hook_suffix, array( $this, 'new_funnel_type' ) );
     126            }
     127        }
    111128    }
    112129
     
    165182        add_action( 'admin_menu', array( $this, 'menu' ), 9 );
    166183        add_action( 'init', array( $this, 'database_upgrade_130' ), 20 );
    167         add_action( 'plugins_loaded', array( $this, 'register_funnel_types' ) );
     184        add_action( 'init', array( $this, 'database_upgrade_131' ), 20 );
     185        add_action( 'after_setup_theme', array( $this, 'register_funnel_types' ) );
    168186    }
    169187
     
    182200                'post_type' => 'wp_template',
    183201                'post_status' => array( 'any', 'trash', 'auto-draft' ),
    184                 'meta_input' => array(
    185                     'wpfunnel' => '1'
     202                'meta_key' => 'wpfunnel',
     203                'meta_value' => '1',
     204                'posts_per_page' => -1
     205            )
     206        );
     207
     208        foreach ( $funnel_types->posts as $post )
     209        {
     210            wp_set_post_terms( $post->ID, array(), 'wp_theme' );
     211        }
     212
     213        // If upgrading to 130 on version 1.3.1, skip the upgrade to 131
     214        update_option( 'wpfunnel_db_version', '131' );
     215    }
     216
     217    /**
     218     * Fixes a now-removed error with the 130 upgrade routine.
     219     *
     220     * @since 1.3.1
     221     */
     222    public function database_upgrade_131()
     223    {
     224        if ( $this->get_db_version() >= 131 || !current_theme_supports( 'block-templates' ) )
     225        return;
     226
     227        $not_funnel_types = new \WP_Query(
     228            array(
     229                'post_type' => 'wp_template',
     230                'post_status' => array( 'any', 'trash', 'auto-draft' ),
     231                'meta_query' => array(
     232                    'relation' => 'OR',
     233                    array(
     234                        'key' => 'wpfunnel',
     235                        'compare' => 'NOT EXISTS'
     236                    ),
     237                    array(
     238                        'key' => 'wpfunnel',
     239                        'value' => '1',
     240                        'compare' => '!='
     241                    )
     242                ),
     243                'tax_query' => array(
     244                    array(
     245                        'taxonomy' => 'wp_theme',
     246                        'operator' => 'NOT EXISTS'
     247                    )
    186248                ),
    187249                'posts_per_page' => -1
     
    189251        );
    190252
    191         foreach ( $funnel_types->posts as $post )
    192         {
    193             wp_set_post_terms( $post->ID, array(), 'wp_theme' );
    194         }
    195 
    196         update_option( 'wpfunnel_db_version', '130' );
     253        foreach ( $funnel_types->posts as $post )
     254        {
     255            wp_set_post_terms( $post->ID, );
     256        }
     257
     258        update_option( 'wpfunnel_db_version', '13' );
    197259    }
    198260
    199261    public function no_funnels_notice()
    200262    {
    201         if ( empty( $this->funnel_types ) )
    202         {
    203             echo '<div class="notice notice-warning"><p>Thank you for activating WP Funnel Manager! To start building funnels, just click on Funnels in the admin menu.</p></div>';
     263        if ( )
     264        {
     265            echo '<div class="notice notice-warning"><p>Thank you for </p></div>';
    204266        }
    205267    }
  • wp-funnel-manager/trunk/wp-funnel-manager.php

    r2569689 r2676816  
    44 * Plugin URI:
    55 * Description: Organises content into multi-step funnels.
    6  * Version: 1.3.0
     6 * Version: 1.3.
    77 * Requires at least: 5.8
     8
    89 * Author: Ask Carlo
    910 * Author URI: https://askcarlo.com
Note: See TracChangeset for help on using the changeset viewer.