From 46375b5772dfd4969ac152a6f43ecd94724ddb37 Mon Sep 17 00:00:00 2001 From: Warwick Date: Wed, 29 Jan 2025 11:02:22 +0200 Subject: [PATCH 01/17] Removing the uneeded files and removing the get_instances --- classes/class-admin.php | 36 ------- classes/class-core.php | 19 +--- classes/class-custom-post-type.php | 140 ------------------------- classes/class-frontend.php | 109 ------------------- classes/class-integrations.php | 45 -------- classes/class-post-type.php | 67 ------------ classes/class-setup.php | 37 +++---- includes/functions.php | 81 -------------- includes/template-tags.php | 6 -- templates/archive-custom-post-type.php | 53 ---------- templates/content-custom-post-type.php | 58 ---------- templates/single-custom-post-type.php | 54 ---------- templates/taxonomy-term.php | 53 ---------- 13 files changed, 21 insertions(+), 737 deletions(-) delete mode 100644 classes/class-custom-post-type.php delete mode 100644 classes/class-frontend.php delete mode 100644 classes/class-integrations.php delete mode 100644 classes/class-post-type.php delete mode 100644 includes/functions.php delete mode 100644 includes/template-tags.php delete mode 100644 templates/archive-custom-post-type.php delete mode 100644 templates/content-custom-post-type.php delete mode 100644 templates/single-custom-post-type.php delete mode 100644 templates/taxonomy-term.php diff --git a/classes/class-admin.php b/classes/class-admin.php index 2f4a14a..22de53a 100644 --- a/classes/class-admin.php +++ b/classes/class-admin.php @@ -21,41 +21,5 @@ class Admin { * Contructor */ public function __construct() { - // Enqueue scripts for all admin pages. - add_action( 'admin_enqueue_scripts', array( $this, 'assets' ) ); } - - /** - * Return an instance of this class. - * - * @since 1.0.0 - * - * @return object \lsx\member_directory\classes\Admin() A single instance of this class. - */ - public static function get_instance() { - - // If the single instance hasn't been set, set it now. - if ( null == self::$instance ) { - self::$instance = new self(); - } - - return self::$instance; - - } - - /** - * Various assest we want loaded for admin pages. - * - * @return void - */ - public function assets() { - // wp_enqueue_media(); - wp_enqueue_script( 'media-upload' ); - wp_enqueue_script( 'thickbox' ); - wp_enqueue_style( 'thickbox' ); - - wp_enqueue_script( 'lsx-starter-plugin-admin', LSX_STARTER_PLUGIN_URL . 'assets/js/lsx-starter-plugin-admin.min.js', array( 'jquery' ), LSX_STARTER_PLUGIN_VER, true ); - wp_enqueue_style( 'lsx-starter-plugin-admin', LSX_STARTER_PLUGIN_URL . 'assets/css/lsx-starter-plugin-admin.css', array(), LSX_STARTER_PLUGIN_VER ); - } - } diff --git a/classes/class-core.php b/classes/class-core.php index 0ba1c85..94a0d4c 100644 --- a/classes/class-core.php +++ b/classes/class-core.php @@ -73,26 +73,11 @@ public static function get_instance() { private function load_classes() { // Load plugin settings related functionality. require_once LSX_STARTER_PLUGIN_PATH . '/classes/class-setup.php'; - $this->setup = Setup::get_instance(); + $this->setup = new Setup(); // Load plugin admin related functionality. require_once LSX_STARTER_PLUGIN_PATH . 'classes/class-admin.php'; - $this->admin = Admin::get_instance(); - - // Load front-end related functionality. - require_once LSX_STARTER_PLUGIN_PATH . '/classes/class-frontend.php'; - $this->frontend = Frontend::get_instance(); - - // Load 3rd party integrations here. - require_once LSX_STARTER_PLUGIN_PATH . '/classes/class-integrations.php'; - $this->integrations = Integrations::get_instance(); - } - - /** - * Loads the plugin functions. - */ - private function load_includes() { - require_once LSX_STARTER_PLUGIN_PATH . '/includes/functions.php'; + $this->admin = new Admin(); } /** diff --git a/classes/class-custom-post-type.php b/classes/class-custom-post-type.php deleted file mode 100644 index 59e45f1..0000000 --- a/classes/class-custom-post-type.php +++ /dev/null @@ -1,140 +0,0 @@ - esc_html__( 'Custom', 'lsx-starter-plugin' ), - 'singular_name' => esc_html__( 'Customs', 'lsx-starter-plugin' ), - 'add_new' => esc_html_x( 'Add New', 'post type general name', 'lsx-starter-plugin' ), - 'add_new_item' => esc_html__( 'Add New', 'lsx-starter-plugin' ), - 'edit_item' => esc_html__( 'Edit', 'lsx-starter-plugin' ), - 'new_item' => esc_html__( 'New', 'lsx-starter-plugin' ), - 'all_items' => esc_html__( 'All', 'lsx-starter-plugin' ), - 'view_item' => esc_html__( 'View', 'lsx-starter-plugin' ), - 'search_items' => esc_html__( 'Search', 'lsx-starter-plugin' ), - 'not_found' => esc_html__( 'None found', 'lsx-starter-plugin' ), - 'not_found_in_trash' => esc_html__( 'None found in Trash', 'lsx-starter-plugin' ), - 'parent_item_colon' => '', - 'menu_name' => esc_html__( 'Customs', 'lsx-starter-plugin' ), - ); - $args = array( - 'labels' => $labels, - 'public' => true, - 'publicly_queryable' => true, - 'show_ui' => true, - 'show_in_menu' => true, - 'menu_icon' => 'dashicons-welcome-write-blog', - 'query_var' => true, - 'rewrite' => array( - 'slug' => 'custom-post-type', - ), - 'capability_type' => 'post', - 'has_archive' => false, - 'hierarchical' => false, - 'menu_position' => null, - 'supports' => array( - 'title', - 'editor', - 'thumbnail', - 'excerpt', - ), - ); - register_post_type( $this->slug, $args ); - } - - /** - * Register the Week taxonomy. - */ - public function taxonomy_setup() { - $labels = array( - 'name' => esc_html_x( 'Term', 'taxonomy general name', 'lsx-starter-plugin' ), - 'singular_name' => esc_html_x( 'Term', 'taxonomy singular name', 'lsx-starter-plugin' ), - 'search_items' => esc_html__( 'Search', 'lsx-starter-plugin' ), - 'all_items' => esc_html__( 'All', 'lsx-starter-plugin' ), - 'parent_item' => esc_html__( 'Parent', 'lsx-starter-plugin' ), - 'parent_item_colon' => esc_html__( 'Parent:', 'lsx-starter-plugin' ), - 'edit_item' => esc_html__( 'Edit', 'lsx-starter-plugin' ), - 'update_item' => esc_html__( 'Update', 'lsx-starter-plugin' ), - 'add_new_item' => esc_html__( 'Add New', 'lsx-starter-plugin' ), - 'new_item_name' => esc_html__( 'New Name', 'lsx-starter-plugin' ), - 'menu_name' => esc_html__( 'Terms', 'lsx-starter-plugin' ), - ); - - $args = array( - 'hierarchical' => true, - 'labels' => $labels, - 'show_ui' => true, - 'show_admin_column' => true, - 'query_var' => true, - 'rewrite' => array( - 'slug' => 'term', - ), - ); - - register_taxonomy( 'term', array( 'custom_post_type' ), $args ); - } - /** - * Adds the post type to the different arrays. - * - * @param array $post_types - * @return array - */ - public function enable_post_type( $post_types = array() ) { - $post_types[] = $this->slug; - return $post_types; - } -} diff --git a/classes/class-frontend.php b/classes/class-frontend.php deleted file mode 100644 index 4b751a5..0000000 --- a/classes/class-frontend.php +++ /dev/null @@ -1,109 +0,0 @@ - admin_url( 'admin-ajax.php' ), - )); - - wp_localize_script( 'lsx-starter-plugin', 'lsx_customizer_params', $params ); - - wp_enqueue_style( 'lsx-starter-plugin', LSX_STARTER_PLUGIN_URL . 'assets/css/lsx-starter-plugin.css', array(), LSX_STARTER_PLUGIN_VER ); - wp_style_add_data( 'lsx-starter-plugin', 'rtl', 'replace' ); - } - - /** - * Archive template. - */ - public function archive_template_include( $template ) { - $applicable_post_types = apply_filters( 'lsx_starter_plugin_archive_template', array() ); - if ( ! empty( $applicable_post_types ) && is_main_query() && is_post_type_archive( $applicable_post_types ) ) { - $post_type = get_post_type(); - if ( empty( locate_template( array( 'archive-' . $post_type . '.php' ) ) ) && file_exists( LSX_STARTER_PLUGIN_PATH . 'templates/archive-' . $post_type . '.php' ) ) { - $template = LSX_STARTER_PLUGIN_PATH . 'templates/archive-' . $post_type . '.php'; - } - } - return $template; - } - - /** - * Single template. - */ - public function single_template_include( $template ) { - $applicable_post_types = apply_filters( 'lsx_starter_plugin_single_template', array() ); - if ( ! empty( $applicable_post_types ) && is_main_query() && is_singular( $applicable_taxonomies ) ) { - $post_type = get_post_type(); - if ( empty( locate_template( array( 'single-' . $post_type . '.php' ) ) ) && file_exists( LSX_STARTER_PLUGIN_PATH . 'templates/single-' . $post_type . '.php' ) ) { - $template = LSX_STARTER_PLUGIN_PATH . 'templates/single-' . $post_type . '.php'; - } - } - return $template; - } - - /** - * Redirect wordpress to the taxonomy located in the plugin - * - * @param $template string - * @return string - */ - public function taxonomy_template_include( $template ) { - $applicable_taxonomies = apply_filters( 'lsx_starter_plugin_taxonomies_template', array() ); - if ( is_main_query() && is_tax( $applicable_taxonomies ) ) { - $current_taxonomy = get_query_var( 'taxonomy' ); - if ( '' == locate_template( array( 'taxonomy-' . $current_taxonomy . '.php' ) ) && file_exists( LSX_STARTER_PLUGIN_PATH . 'templates/taxonomy-' . $current_taxonomy . '.php' ) ) { - $template = LSX_STARTER_PLUGIN_PATH . 'templates/taxonomy-' . $current_taxonomy . '.php'; - } - } - return $template; - } -} diff --git a/classes/class-integrations.php b/classes/class-integrations.php deleted file mode 100644 index 5ebe6ec..0000000 --- a/classes/class-integrations.php +++ /dev/null @@ -1,45 +0,0 @@ -enable_post_types(); - add_filter( 'lsx_starter_plugin_post_types', array( $this, 'enable_post_types' ) ); - foreach ( $this->post_types as $post_type ) { - require_once LSX_STARTER_PLUGIN_PATH . 'classes/class-' . $post_type . '.php'; - $classname = ucwords( $post_type ); - $this->$post_type = call_user_func_array( '\\lsx_starter_plugin\classes\\' . $classname . '::get_instance', array() ); - } - } - - /** - * Return an instance of this class. - * - * @since 1.0.0 - * - * @return object \lsx_starter_plugin\classes\Post_Type() A single instance of this class. - */ - public static function get_instance() { - // If the single instance hasn't been set, set it now. - if ( null == self::$instance ) { - self::$instance = new self(); - } - return self::$instance; - } - - /** - * Enable our post types - * - * @return void - */ - public function enable_post_types() { - $this->post_types = array( - 'custom-post-type', - ); - return $post_types; - } -} diff --git a/classes/class-setup.php b/classes/class-setup.php index 30a023e..52f358a 100644 --- a/classes/class-setup.php +++ b/classes/class-setup.php @@ -17,33 +17,34 @@ class Setup { protected static $instance = null; /** - * @var object \lsx_health_plan\classes\Post_Type(); + * Contructor */ - public $post_types; + public function __construct() { + add_action( 'init', [ $this, 'load_plugin_textdomain' ] ); + + // Enqueue the assets. + add_action( 'admin_enqueue_scripts', [ $this, 'admin_assets' ] ); + } /** - * Contructor + * Adds text domain. */ - public function __construct() { - require_once( LSX_STARTER_PLUGIN_PATH . 'classes/class-post-type.php' ); - $this->post_types = Post_Type::get_instance(); + function load_plugin_textdomain() { + load_plugin_textdomain( 'lsx-starter-plugin', false, basename( LSX_STARTER_PLUGIN_PATH ) . '/languages' ); } /** - * Return an instance of this class. - * - * @since 1.0.0 + * Various assest we want loaded for admin pages. * - * @return object \lsx_starter_plugin\classes\Setup() A single instance of this class. + * @return void */ - public static function get_instance() { - - // If the single instance hasn't been set, set it now. - if ( null == self::$instance ) { - self::$instance = new self; - } - - return self::$instance; + public function admin_assets() { + // wp_enqueue_media(); + wp_enqueue_script( 'media-upload' ); + wp_enqueue_script( 'thickbox' ); + wp_enqueue_style( 'thickbox' ); + wp_enqueue_script( 'lsx-starter-plugin-admin', LSX_STARTER_PLUGIN_URL . 'assets/js/lsx-starter-plugin-admin.min.js', array( 'jquery' ), LSX_STARTER_PLUGIN_VER, true ); + wp_enqueue_style( 'lsx-starter-plugin-admin', LSX_STARTER_PLUGIN_URL . 'assets/css/lsx-starter-plugin-admin.css', array(), LSX_STARTER_PLUGIN_VER ); } } diff --git a/includes/functions.php b/includes/functions.php deleted file mode 100644 index 8711074..0000000 --- a/includes/functions.php +++ /dev/null @@ -1,81 +0,0 @@ - $prefix . '_metabox', - 'title' => esc_html__( 'Business Directory CMB2 Metabox', 'lsx-starter-plugin' ), // Doesn't output for user boxes - 'object_types' => array( 'page' ), // Tells CMB2 to use user_meta vs post_meta - // 'show_on' => array( - // 'id' => array( 2 ), - // ), // Specific post IDs to display this metabox - ) - ); - - $cmb_demo->add_field( - array( - 'name' => esc_html__( 'Business Name', 'lsx-starter-plugin' ), - 'desc' => esc_html__( 'your business name', 'lsx-starter-plugin' ), - 'id' => $prefix . '_business_name', - 'type' => 'text', - ) - ); - - $cmb_demo->add_field( - array( - 'name' => esc_html__( 'Business Description', 'lsx-starter-plugin' ), - 'desc' => esc_html__( 'describe your business', 'lsx-starter-plugin' ), - 'id' => $prefix . '_business_description', - 'type' => 'wysiwyg', - 'options' => array( - 'textarea_rows' => 5, - ), - ) - ); - - $cmb_demo->add_field( - array( - 'name' => esc_html__( 'Business Logo', 'lsx-starter-plugin' ), - 'desc' => esc_html__( 'select your business logo', 'lsx-starter-plugin' ), - 'id' => $prefix . '_business_logo', - 'type' => 'file', - ) - ); - - $cmb_demo->add_field( - array( - 'name' => esc_html__( 'Business Email', 'lsx-starter-plugin' ), - 'desc' => esc_html__( 'your business email', 'lsx-starter-plugin' ), - 'id' => $prefix . '_business_email', - 'type' => 'text_email', - 'repeatable' => true, - ) - ); - - $cmb_demo->add_field( - array( - 'name' => esc_html__( 'Business Phone', 'lsx-starter-plugin' ), - 'desc' => esc_html__( 'your business phone', 'lsx-starter-plugin' ), - 'id' => $prefix . '_business_phone', - 'type' => 'text', - 'repeatable' => true, - ) - ); -} -// add_action( 'cmb2_init', 'register_businessdirectory_metabox' ); diff --git a/includes/template-tags.php b/includes/template-tags.php deleted file mode 100644 index e63fa64..0000000 --- a/includes/template-tags.php +++ /dev/null @@ -1,6 +0,0 @@ - - - - -
- - - -
- - - - - -
- - - - - - - -
- - - - - - - - - - - -
- - - -
- - - - - - - - - -
> - - - - - -
- '
', - 'after' => '
', - 'link_before' => '', - 'link_after' => '', - ) ); - ?> -
- -
- -
- - - -
- - - - - -
- - - -
- - - - - - - - - - - - - - - -
- - - - - - - -
- - - - - - - - - -
- - - -
- - - - - -
- - - - - - - -
- - - - - - - - - - - -
- - - -
- - - - - - Date: Wed, 29 Jan 2025 11:23:55 +0200 Subject: [PATCH 02/17] Adding in the vendors --- .DS_Store | Bin 0 -> 6148 bytes classes/class-core.php | 31 +-- classes/class-setup.php | 5 - post-types/accommodation.json | 424 ++++++++++++++++++++++++++++++++++ post-types/destination.json | 80 +++++++ post-types/tour.json | 107 +++++++++ 6 files changed, 613 insertions(+), 34 deletions(-) create mode 100644 .DS_Store create mode 100644 post-types/accommodation.json create mode 100644 post-types/destination.json create mode 100644 post-types/tour.json diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..65f2b92cdf38f7a8f36bae4fd4747c5f7d75926c GIT binary patch literal 6148 zcmeHKOK#gR5FI*hN+l?uMGa(0pj!vAf%J!N6vw$hRV0ffaIDBkgvz2|$#DzAfOhRg zdW2k|N9e96=p{Ns(m@>OgKUZ-m;uN~4(IXnD3Brmh|V}}1NZ z=b=Vn`q+dLzCsQID3+qx@jog+d$)!=rg6tgxVC?BahgV2r!?tRxWFyVAjYs!G%4~Z z)e-tHqdZNDveo(}YAf|;tIwsB>+(1}*ORd9m*b+-A01Nd6Lu8M%l&9S8BBWq%Uzw7 z{UjTV3?YdJ7;T58Q@xor)wKQk?RHbWd%r!Kd9v|p z>%+(1=X99qZ!}~4An}Vd_QK&DzGGowL3ge+J!^-jdYI3dH;F^t?K&mopWk2n#*d#n z%Q5kTG5PuZ<6MNJEY;Z=_B~(JwJC9t6<`HefyXQ04imZlcq%hk0aoCND?sOi!bBK2 ztSp+N12gjkK&+$N7?$ZRK^)~Ua9CNy7Bpe0h?Xkc6GK=!`jv|d999-B9fW&)2sg5D zFBD-$$NrTG2N780oE2aN78O{rRiEzvy}RH4izKeG0<6H3Qb5$ZVYh=za(C;};^?kb um`*T}QCwy5ih>1m6=N)2#T%H6pqK}L=PJO2pAbSV+H=H0)GJkWOe}n literal 0 HcmV?d00001 diff --git a/classes/class-core.php b/classes/class-core.php index 94a0d4c..d59fcc1 100644 --- a/classes/class-core.php +++ b/classes/class-core.php @@ -27,29 +27,11 @@ class Core { */ public $admin; - /** - * @var object \lsx_starter_plugin\classes\Frontend(); - */ - public $frontend; - - /** - * @var object \lsx_starter_plugin\classes\Integrations(); - */ - public $integrations; - - /** - * The post types available - * - * @var array - */ - public $post_types = array(); - /** * Contructor */ public function __construct() { $this->load_classes(); - $this->load_includes(); } /** @@ -76,16 +58,7 @@ private function load_classes() { $this->setup = new Setup(); // Load plugin admin related functionality. - require_once LSX_STARTER_PLUGIN_PATH . 'classes/class-admin.php'; - $this->admin = new Admin(); - } - - /** - * Returns the post types currently active - * - * @return void - */ - public function get_post_types() { - return apply_filters( 'lsx_starter_plugin_post_types', $this->post_types ); + /*require_once LSX_STARTER_PLUGIN_PATH . 'classes/class-admin.php'; + $this->admin = new Admin();*/ } } diff --git a/classes/class-setup.php b/classes/class-setup.php index 52f358a..0d25f11 100644 --- a/classes/class-setup.php +++ b/classes/class-setup.php @@ -39,11 +39,6 @@ function load_plugin_textdomain() { * @return void */ public function admin_assets() { - // wp_enqueue_media(); - wp_enqueue_script( 'media-upload' ); - wp_enqueue_script( 'thickbox' ); - wp_enqueue_style( 'thickbox' ); - wp_enqueue_script( 'lsx-starter-plugin-admin', LSX_STARTER_PLUGIN_URL . 'assets/js/lsx-starter-plugin-admin.min.js', array( 'jquery' ), LSX_STARTER_PLUGIN_VER, true ); wp_enqueue_style( 'lsx-starter-plugin-admin', LSX_STARTER_PLUGIN_URL . 'assets/css/lsx-starter-plugin-admin.css', array(), LSX_STARTER_PLUGIN_VER ); } diff --git a/post-types/accommodation.json b/post-types/accommodation.json new file mode 100644 index 0000000..cae0834 --- /dev/null +++ b/post-types/accommodation.json @@ -0,0 +1,424 @@ +{ + "type": "postType", + "postType": "accommodation", + "slug": "accommodation", + "label": "Accommodation", + "pluralLabel": "Accommodation", + "icon": "admin-multisite", + "hasArchive": "accommodation", + "hierarchical": false, + "showInRest": true, + "showInMenu": "tour-operator", + "menuPosition": 20, + "template": [], + "fields": [ + { + "slug": "tagline", + "type": "string", + "label": "Tagline", + "description": "", + "visible": true + }, + { + "slug": "price", + "type": "string", + "label": "Price From", + "description": "Set the minimum price of the accommodation.", + "visible": true + }, + { + "slug": "sale_price", + "type": "string", + "label": "Sale Price", + "description": "Set the sale price of the accommodation.", + "visible": true + }, + { + "slug": "price_type", + "type": "select", + "label": "Price Type", + "description": "The type of pricing for this accommodation. (e.g. per person per night)", + "visible": true, + "options": [ + { + "label": "Select a type", + "value": "none" + }, + { + "label": "Per Person Per Night", + "value": "per_person_per_night" + }, + { + "label": "Per Person Sharing", + "value": "per_person_sharing" + }, + { + "label": "Per Person Sharing Per Night", + "value": "per_person_sharing_per_night" + }, + { + "label": "Percentage Off Your Price", + "value": "total_percentage" + } + ] + }, + { + "slug": "single_supplement", + "type": "string", + "label": "Single Supplement", + "description": "Set the additional cost for a single person booking the accommodation.", + "visible": true + }, + { + "slug": "rating", + "type": "select", + "label": "Rating", + "description": "Select the star rating for the accommodation (e.g., 3 stars, 5 stars).", + "visible": true, + "options": [ + { + "label": "0", + "value": "0" + }, + { + "label": "1", + "value": "1" + }, + { + "label": "2", + "value": "2" + }, + { + "label": "3", + "value": "3" + }, + { + "label": "4", + "value": "4" + }, + { + "label": "5", + "value": "5" + } + ], + "allow_none": true + }, + { + "slug": "rating_type", + "type": "select", + "label": "Rating Type", + "description": "Choose the rating type (e.g., user reviews, official star ratings).", + "visible": true, + "options": [ + { + "label": "Unspecified", + "value": "unspecified" + }, + { + "label": "TGCSA", + "value": "tgcsa" + }, + { + "label": "Hotelstars Union", + "value": "hotelstars_union" + } + ] + }, + { + "slug": "best_time_to_visit", + "type": "multiselect", + "label": "Best time to visit", + "description": "The ideal months or season for visiting the accommodation.", + "visible": true, + "options": [ + { + "label": "January", + "value": "january" + }, + { + "label": "February", + "value": "february" + }, + { + "label": "March", + "value": "march" + }, + { + "label": "April", + "value": "april" + }, + { + "label": "May", + "value": "may" + }, + { + "label": "June", + "value": "june" + }, + { + "label": "July", + "value": "july" + }, + { + "label": "August", + "value": "august" + }, + { + "label": "September", + "value": "september" + }, + { + "label": "October", + "value": "october" + }, + { + "label": "November", + "value": "november" + }, + { + "label": "December", + "value": "december" + } + ] + }, + { + "slug": "spoken_languages", + "type": "multiselect", + "label": "Spoken Languages", + "description": "Select the languages commonly spoken by the staff.", + "visible": true, + "options": [ + { + "label": "Afrikaans", + "value": "afrikaans" + }, + { + "label": "Chinese", + "value": "chinese" + }, + { + "label": "Dutch", + "value": "dutch" + }, + { + "label": "English", + "value": "english" + }, + { + "label": "Flemish", + "value": "flemish" + }, + { + "label": "French", + "value": "french" + }, + { + "label": "German", + "value": "german" + }, + { + "label": "Indian", + "value": "indian" + }, + { + "label": "Italian", + "value": "italian" + }, + { + "label": "Japanese", + "value": "japanese" + }, + { + "label": "Portuguese", + "value": "portuguese" + }, + { + "label": "Russian", + "value": "russian" + }, + { + "label": "Spanish", + "value": "spanish" + }, + { + "label": "Swahili", + "value": "swahili" + }, + { + "label": "Xhosa", + "value": "xhosa" + }, + { + "label": "Zulu", + "value": "zulu" + } + ] + }, + { + "slug": "suggested_visitor_types", + "type": "multiselect", + "label": "Friendly", + "description": "Choose the types of visitors the accommodation is best suited for (e.g., family-friendly, pet-friendly).", + "visible": true, + "options": [ + { + "label": "Business", + "value": "business" + }, + { + "label": "Children", + "value": "children" + }, + { + "label": "Disability", + "value": "disability" + }, + { + "label": "Leisure", + "value": "leisure" + }, + { + "label": "Luxury", + "value": "luxury" + }, + { + "label": "Pet", + "value": "pet" + }, + { + "label": "Romance", + "value": "romance" + }, + { + "label": "Vegetarian", + "value": "vegetarian" + }, + { + "label": "Weddings", + "value": "weddings" + } + ] + }, + { + "slug": "special_interests", + "type": "multiselect", + "label": "Special Interests", + "description": "Special interests that the accommodation caters to, such as wildlife or adventure.", + "visible": true, + "options": [ + { + "label": "Adventure", + "value": "adventure" + }, + { + "label": "Battlefields", + "value": "battlefields" + }, + { + "label": "Beach / Coastal", + "value": "beach_coastal" + }, + { + "label": "Big 5", + "value": "big-5" + }, + { + "label": "Birding", + "value": "birding" + }, + { + "label": "Cycling", + "value": "cycling" + }, + { + "label": "Fishing", + "value": "fishing" + }, + { + "label": "Flora", + "value": "flora" + }, + { + "label": "Golf", + "value": "golf" + }, + { + "label": "Gourmet", + "value": "gourmet" + }, + { + "label": "Hiking", + "value": "hiking" + }, + { + "label": "History & Culture", + "value": "history-and-culture" + }, + { + "label": "Indigenous Culture / Art", + "value": "indigenous-culture-art" + }, + { + "label": "Leisure", + "value": "leisure" + }, + { + "label": "Nature Relaxation", + "value": "nature-relaxation" + }, + { + "label": "Shopping", + "value": "shopping" + }, + { + "label": "Sports", + "value": "sports" + }, + { + "label": "Star Gazing", + "value": "star-gazing" + }, + { + "label": "Watersports", + "value": "watersports" + }, + { + "label": "Wildlife", + "value": "wildlife" + }, + { + "label": "Wine", + "value": "wine" + } + ] + }, + { + "slug": "number_of_rooms", + "type": "text", + "label": "Number of Rooms", + "description": "Enter the total number of rooms or units at the accommodation.", + "visible": true + }, + { + "slug": "checkin_time", + "type": "text_time", + "label": "Check-in Time", + "description": "Enter the standard check-in time for the accommodation.", + "visible": true + }, + { + "slug": "checkout_time", + "type": "text_time", + "label": "Check-out Time", + "description": "Enter the standard check-out time for the accommodation.", + "visible": true + }, + { + "slug": "minimum_child_age", + "type": "text", + "label": "Minimum Child Age", + "description": "Set the minimum child age allowed by the accommodation.", + "visible": true + } + ] +} diff --git a/post-types/destination.json b/post-types/destination.json new file mode 100644 index 0000000..9f0afe7 --- /dev/null +++ b/post-types/destination.json @@ -0,0 +1,80 @@ +{ + "type": "postType", + "postType": "destination", + "slug": "destination", + "label": "Destination", + "pluralLabel": "Destinations", + "icon": "admin-site", + "hasArchive": "destination", + "hierarchical": true, + "showInRest": true, + "showInMenu": "tour-operator", + "menuPosition": 30, + "template": [], + "fields": [ + { + "slug": "tagline", + "type": "string", + "label": "Tagline", + "description": "", + "visible": true + }, + { + "slug": "best_time_to_visit", + "type": "multiselect", + "label": "Best time to visit", + "description": "", + "visible": true, + "options": [ + { + "label": "January", + "value": "january" + }, + { + "label": "February", + "value": "february" + }, + { + "label": "March", + "value": "march" + }, + { + "label": "April", + "value": "april" + }, + { + "label": "May", + "value": "may" + }, + { + "label": "June", + "value": "june" + }, + { + "label": "July", + "value": "july" + }, + { + "label": "August", + "value": "august" + }, + { + "label": "September", + "value": "september" + }, + { + "label": "October", + "value": "october" + }, + { + "label": "November", + "value": "november" + }, + { + "label": "December", + "value": "december" + } + ] + } + ] +} diff --git a/post-types/tour.json b/post-types/tour.json new file mode 100644 index 0000000..a9db77f --- /dev/null +++ b/post-types/tour.json @@ -0,0 +1,107 @@ +{ + "type": "postType", + "postType": "tour", + "slug": "tour", + "label": "Tour", + "pluralLabel": "Tours", + "icon": "palmtree", + "hierarchical": false, + "showInRest": true, + "showInMenu": "tour-operator", + "menuPosition": 10, + "template": [], + "fields": [ + { + "slug": "tagline", + "type": "string", + "label": "Tagline", + "description": "", + "visible": true + }, + { + "slug": "price", + "type": "string", + "label": "Price", + "description": "Set the price of the tour.", + "visible": true + }, + { + "slug": "sale_price", + "type": "string", + "label": "Sale Price", + "description": "Set the sale price of the tour.", + "visible": true + }, + { + "slug": "duration", + "type": "string", + "label": "Duration", + "description": "Enter the duration of the tour (in days)", + "visible": true + }, + { + "slug": "single_supplement", + "type": "string", + "label": "Single Supplement", + "description": "Set the additional cost for a single person booking the tour.", + "visible": true + }, + { + "slug": "best_time_to_visit", + "type": "multiselect", + "label": "Best time to visit", + "description": "Select the best months to take the tour.", + "visible": true, + "options": [ + { + "label": "January", + "value": "january" + }, + { + "label": "February", + "value": "february" + }, + { + "label": "March", + "value": "march" + }, + { + "label": "April", + "value": "april" + }, + { + "label": "May", + "value": "may" + }, + { + "label": "June", + "value": "june" + }, + { + "label": "July", + "value": "july" + }, + { + "label": "August", + "value": "august" + }, + { + "label": "September", + "value": "september" + }, + { + "label": "October", + "value": "october" + }, + { + "label": "November", + "value": "november" + }, + { + "label": "December", + "value": "december" + } + ] + } + ] +} From 7ab00085067a016a2d71bb630cc25efaf05d0c2b Mon Sep 17 00:00:00 2001 From: Warwick Date: Wed, 29 Jan 2025 11:37:12 +0200 Subject: [PATCH 03/17] Adding in the create content modal and the post types declaration. --- .DS_Store | Bin 6148 -> 6148 bytes classes/class-core.php | 12 +- lsx-starter-plugin.php | 1 + post-types/accommodation.json | 424 ------------ post-types/post-type.json | 43 ++ vendors/.DS_Store | Bin 0 -> 6148 bytes vendors/create-content-model/.DS_Store | Bin 0 -> 6148 bytes vendors/create-content-model/README.md | 2 + .../create-content-model.php | 35 + .../create-content-model/includes/.DS_Store | Bin 0 -> 6148 bytes .../includes/json-initializer/0-load.php | 15 + .../class-content-model-json-initializer.php | 142 ++++ .../includes/runtime/0-load.php | 17 + .../runtime/class-content-model-block.php | 299 +++++++++ .../class-content-model-data-hydrator.php | 107 +++ .../class-content-model-html-manipulator.php | 151 +++++ .../runtime/class-content-model-manager.php | 99 +++ .../includes/runtime/class-content-model.php | 612 ++++++++++++++++++ .../runtime/dist/data-entry.asset.php | 1 + .../includes/runtime/dist/data-entry.js | 298 +++++++++ .../runtime/dist/templating.asset.php | 1 + .../includes/runtime/dist/templating.js | 1 + .../includes/runtime/helpers.php | 49 ++ 23 files changed, 1884 insertions(+), 425 deletions(-) delete mode 100644 post-types/accommodation.json create mode 100644 post-types/post-type.json create mode 100644 vendors/.DS_Store create mode 100644 vendors/create-content-model/.DS_Store create mode 100644 vendors/create-content-model/README.md create mode 100644 vendors/create-content-model/create-content-model.php create mode 100644 vendors/create-content-model/includes/.DS_Store create mode 100644 vendors/create-content-model/includes/json-initializer/0-load.php create mode 100644 vendors/create-content-model/includes/json-initializer/class-content-model-json-initializer.php create mode 100644 vendors/create-content-model/includes/runtime/0-load.php create mode 100644 vendors/create-content-model/includes/runtime/class-content-model-block.php create mode 100644 vendors/create-content-model/includes/runtime/class-content-model-data-hydrator.php create mode 100644 vendors/create-content-model/includes/runtime/class-content-model-html-manipulator.php create mode 100644 vendors/create-content-model/includes/runtime/class-content-model-manager.php create mode 100644 vendors/create-content-model/includes/runtime/class-content-model.php create mode 100644 vendors/create-content-model/includes/runtime/dist/data-entry.asset.php create mode 100644 vendors/create-content-model/includes/runtime/dist/data-entry.js create mode 100644 vendors/create-content-model/includes/runtime/dist/templating.asset.php create mode 100644 vendors/create-content-model/includes/runtime/dist/templating.js create mode 100644 vendors/create-content-model/includes/runtime/helpers.php diff --git a/.DS_Store b/.DS_Store index 65f2b92cdf38f7a8f36bae4fd4747c5f7d75926c..47cc6c3bdf48e70b4b52364615d0b10a4b8a7a37 100644 GIT binary patch delta 225 zcmZoMXffDez{JnaP{xqTkjIe1kk3%WP(0a|=}0}ASW0nnPEvk;4g(ONN#&#)1}Ep| z7J#In08K@1zKcszPJR+lmgDu^3IWlj#~gud3{@!zRn|C_6=V>yZu5F(FP6>h9Dn%% Djbk+) delta 195 zcmZoMXffDez{JbOP{xqTkjIe1kk3#w*`Dc$8;VFuadJ*letr%E5THopq#Fh&=jRrH zB%lCAezHHacp!>MZhneOQcivnP&LQvyA=YWOOH7M*(hoXGVq(ac`vgU%ftr0&Fmb1 F`2iXXEZhJ9 diff --git a/classes/class-core.php b/classes/class-core.php index d59fcc1..0ea7a3c 100644 --- a/classes/class-core.php +++ b/classes/class-core.php @@ -31,6 +31,7 @@ class Core { * Contructor */ public function __construct() { + $this->load_vendor(); $this->load_classes(); } @@ -54,11 +55,20 @@ public static function get_instance() { */ private function load_classes() { // Load plugin settings related functionality. - require_once LSX_STARTER_PLUGIN_PATH . '/classes/class-setup.php'; + require_once LSX_STARTER_PLUGIN_PATH . 'classes/class-setup.php'; $this->setup = new Setup(); // Load plugin admin related functionality. /*require_once LSX_STARTER_PLUGIN_PATH . 'classes/class-admin.php'; $this->admin = new Admin();*/ } + + /** + * Load the vendors + * + * @return void + */ + private function load_vendor() { + require_once LSX_STARTER_PLUGIN_PATH . 'vendors/create-content-model/create-content-model.php'; + } } diff --git a/lsx-starter-plugin.php b/lsx-starter-plugin.php index 53ed6da..b4c5c65 100644 --- a/lsx-starter-plugin.php +++ b/lsx-starter-plugin.php @@ -20,6 +20,7 @@ define( 'LSX_STARTER_PLUGIN_CORE', __FILE__ ); define( 'LSX_STARTER_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); define( 'LSX_STARTER_PLUGIN_VER', '1.1.0' ); +define( 'CONTENT_MODEL_JSON_PATH', LSX_STARTER_PLUGIN_PATH ); /* ======================= Below is the Plugin Class init ========================= */ diff --git a/post-types/accommodation.json b/post-types/accommodation.json deleted file mode 100644 index cae0834..0000000 --- a/post-types/accommodation.json +++ /dev/null @@ -1,424 +0,0 @@ -{ - "type": "postType", - "postType": "accommodation", - "slug": "accommodation", - "label": "Accommodation", - "pluralLabel": "Accommodation", - "icon": "admin-multisite", - "hasArchive": "accommodation", - "hierarchical": false, - "showInRest": true, - "showInMenu": "tour-operator", - "menuPosition": 20, - "template": [], - "fields": [ - { - "slug": "tagline", - "type": "string", - "label": "Tagline", - "description": "", - "visible": true - }, - { - "slug": "price", - "type": "string", - "label": "Price From", - "description": "Set the minimum price of the accommodation.", - "visible": true - }, - { - "slug": "sale_price", - "type": "string", - "label": "Sale Price", - "description": "Set the sale price of the accommodation.", - "visible": true - }, - { - "slug": "price_type", - "type": "select", - "label": "Price Type", - "description": "The type of pricing for this accommodation. (e.g. per person per night)", - "visible": true, - "options": [ - { - "label": "Select a type", - "value": "none" - }, - { - "label": "Per Person Per Night", - "value": "per_person_per_night" - }, - { - "label": "Per Person Sharing", - "value": "per_person_sharing" - }, - { - "label": "Per Person Sharing Per Night", - "value": "per_person_sharing_per_night" - }, - { - "label": "Percentage Off Your Price", - "value": "total_percentage" - } - ] - }, - { - "slug": "single_supplement", - "type": "string", - "label": "Single Supplement", - "description": "Set the additional cost for a single person booking the accommodation.", - "visible": true - }, - { - "slug": "rating", - "type": "select", - "label": "Rating", - "description": "Select the star rating for the accommodation (e.g., 3 stars, 5 stars).", - "visible": true, - "options": [ - { - "label": "0", - "value": "0" - }, - { - "label": "1", - "value": "1" - }, - { - "label": "2", - "value": "2" - }, - { - "label": "3", - "value": "3" - }, - { - "label": "4", - "value": "4" - }, - { - "label": "5", - "value": "5" - } - ], - "allow_none": true - }, - { - "slug": "rating_type", - "type": "select", - "label": "Rating Type", - "description": "Choose the rating type (e.g., user reviews, official star ratings).", - "visible": true, - "options": [ - { - "label": "Unspecified", - "value": "unspecified" - }, - { - "label": "TGCSA", - "value": "tgcsa" - }, - { - "label": "Hotelstars Union", - "value": "hotelstars_union" - } - ] - }, - { - "slug": "best_time_to_visit", - "type": "multiselect", - "label": "Best time to visit", - "description": "The ideal months or season for visiting the accommodation.", - "visible": true, - "options": [ - { - "label": "January", - "value": "january" - }, - { - "label": "February", - "value": "february" - }, - { - "label": "March", - "value": "march" - }, - { - "label": "April", - "value": "april" - }, - { - "label": "May", - "value": "may" - }, - { - "label": "June", - "value": "june" - }, - { - "label": "July", - "value": "july" - }, - { - "label": "August", - "value": "august" - }, - { - "label": "September", - "value": "september" - }, - { - "label": "October", - "value": "october" - }, - { - "label": "November", - "value": "november" - }, - { - "label": "December", - "value": "december" - } - ] - }, - { - "slug": "spoken_languages", - "type": "multiselect", - "label": "Spoken Languages", - "description": "Select the languages commonly spoken by the staff.", - "visible": true, - "options": [ - { - "label": "Afrikaans", - "value": "afrikaans" - }, - { - "label": "Chinese", - "value": "chinese" - }, - { - "label": "Dutch", - "value": "dutch" - }, - { - "label": "English", - "value": "english" - }, - { - "label": "Flemish", - "value": "flemish" - }, - { - "label": "French", - "value": "french" - }, - { - "label": "German", - "value": "german" - }, - { - "label": "Indian", - "value": "indian" - }, - { - "label": "Italian", - "value": "italian" - }, - { - "label": "Japanese", - "value": "japanese" - }, - { - "label": "Portuguese", - "value": "portuguese" - }, - { - "label": "Russian", - "value": "russian" - }, - { - "label": "Spanish", - "value": "spanish" - }, - { - "label": "Swahili", - "value": "swahili" - }, - { - "label": "Xhosa", - "value": "xhosa" - }, - { - "label": "Zulu", - "value": "zulu" - } - ] - }, - { - "slug": "suggested_visitor_types", - "type": "multiselect", - "label": "Friendly", - "description": "Choose the types of visitors the accommodation is best suited for (e.g., family-friendly, pet-friendly).", - "visible": true, - "options": [ - { - "label": "Business", - "value": "business" - }, - { - "label": "Children", - "value": "children" - }, - { - "label": "Disability", - "value": "disability" - }, - { - "label": "Leisure", - "value": "leisure" - }, - { - "label": "Luxury", - "value": "luxury" - }, - { - "label": "Pet", - "value": "pet" - }, - { - "label": "Romance", - "value": "romance" - }, - { - "label": "Vegetarian", - "value": "vegetarian" - }, - { - "label": "Weddings", - "value": "weddings" - } - ] - }, - { - "slug": "special_interests", - "type": "multiselect", - "label": "Special Interests", - "description": "Special interests that the accommodation caters to, such as wildlife or adventure.", - "visible": true, - "options": [ - { - "label": "Adventure", - "value": "adventure" - }, - { - "label": "Battlefields", - "value": "battlefields" - }, - { - "label": "Beach / Coastal", - "value": "beach_coastal" - }, - { - "label": "Big 5", - "value": "big-5" - }, - { - "label": "Birding", - "value": "birding" - }, - { - "label": "Cycling", - "value": "cycling" - }, - { - "label": "Fishing", - "value": "fishing" - }, - { - "label": "Flora", - "value": "flora" - }, - { - "label": "Golf", - "value": "golf" - }, - { - "label": "Gourmet", - "value": "gourmet" - }, - { - "label": "Hiking", - "value": "hiking" - }, - { - "label": "History & Culture", - "value": "history-and-culture" - }, - { - "label": "Indigenous Culture / Art", - "value": "indigenous-culture-art" - }, - { - "label": "Leisure", - "value": "leisure" - }, - { - "label": "Nature Relaxation", - "value": "nature-relaxation" - }, - { - "label": "Shopping", - "value": "shopping" - }, - { - "label": "Sports", - "value": "sports" - }, - { - "label": "Star Gazing", - "value": "star-gazing" - }, - { - "label": "Watersports", - "value": "watersports" - }, - { - "label": "Wildlife", - "value": "wildlife" - }, - { - "label": "Wine", - "value": "wine" - } - ] - }, - { - "slug": "number_of_rooms", - "type": "text", - "label": "Number of Rooms", - "description": "Enter the total number of rooms or units at the accommodation.", - "visible": true - }, - { - "slug": "checkin_time", - "type": "text_time", - "label": "Check-in Time", - "description": "Enter the standard check-in time for the accommodation.", - "visible": true - }, - { - "slug": "checkout_time", - "type": "text_time", - "label": "Check-out Time", - "description": "Enter the standard check-out time for the accommodation.", - "visible": true - }, - { - "slug": "minimum_child_age", - "type": "text", - "label": "Minimum Child Age", - "description": "Set the minimum child age allowed by the accommodation.", - "visible": true - } - ] -} diff --git a/post-types/post-type.json b/post-types/post-type.json new file mode 100644 index 0000000..5e77d7c --- /dev/null +++ b/post-types/post-type.json @@ -0,0 +1,43 @@ +{ + "type": "postType", + "postType": "post_type", + "slug": "post-type", + "label": "Post Type", + "pluralLabel": "Post Type", + "icon": "admin-multisite", + "hasArchive": "post-types", + "hierarchical": false, + "showInRest": true, + "menuPosition": 20, + "template": [], + "fields": [ + { + "slug": "text_field", + "type": "string", + "label": "Text Field", + "description": "", + "visible": true + }, + { + "slug": "select_field", + "type": "multiselect", + "label": "Multiselect", + "description": "", + "visible": true, + "options": [ + { + "label": "One", + "value": "one" + }, + { + "label": "Two", + "value": "two" + }, + { + "label": "Three", + "value": "three" + } + ] + } + ] +} diff --git a/vendors/.DS_Store b/vendors/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..a3b8a455750e020528c138bcb7a9476741d628e8 GIT binary patch literal 6148 zcmeHKK~4iP476zvD{<+eLL75L9D3*vLbbf0AAoid9Cn)u!9Abh2fTsz@C3%OLA&Z6 zKu8FIEhXcP?Zg>rlbDEj_1G+lW<*q>39=|7BEzGmBXgbtxym}24s@ji0LnAE z2z03>BqkU}!>kAkgf$eXp=>1vYdFS(`9;I5sNuv`e6X$jUc7Kw9rK6cP8=1zcLtn+ zAp;ZroXP!viC<>4$RCFImowlD{4oZ2TCeLBHf49~!S>{?4QN+rBI1`tfj}QT0`MW{ f$Z0XEJ%|p!XqXjc78x($Kz|4nLcDVZet>~D{c1n? literal 0 HcmV?d00001 diff --git a/vendors/create-content-model/.DS_Store b/vendors/create-content-model/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..ff51c24e570d0c7b27d605433fe0460c5057c7db GIT binary patch literal 6148 zcmeHK%}T>S5T0$TZYV+z7CbI^E!aZ+!%L|31&ruHr8Z5`V9b`LwTDv3O<%}Y@p+ut z-HH-D2_j_%X1?wGY&u`cZU+EFXBxEtY5*Wn2}>TDZ-nBc1t~dC8Bv%$rVzmpvT&A- z3fb)Vj||YelMq7+14!W0`wJ5tV(c{>C2=-sHs3_4Tv=P+kWyCVO>nPg!K6Q#W}W`{ ziawodorKGEKfH*CvtDiMM5mK}oDRpPAdZHZa(x-6k)Cz*G>tM-8`yyKJg--)&*#mC z+Fvx(ytQ}GZm7ef_G015`p)k0S??ivO!c#6Qs9ry$fm<3yx^kHRFn;p5WgfP6@pK} zI8AhVhq2|Rl*hshFaylMYBJzXI$2%K_P8r%fEoA&19UzpR6^fjZqXbaXv_$JSV6ZD zT+=K;HOisyFt>;i6k$sdZK-f0hOp)6S1!+Ym|L{vAl&dF+>?cyP=t9p?ypQb2;U-G zW`G&^$^gxNC^fqOPk)~OO%fYsfEid#21KPBbUWCayITug(p{@iZ&67oFSqznf(vsM gV=i6A+o(p+uV{hjJIpPj2ZjF#7#i3x1AofEJK%& esc_html__( 'Return to Plugins Page' ), + 'link_url' => esc_url( admin_url( 'plugins.php' ) ), + ) + );*/ + return; +} + +define( 'CONTENT_MODEL_PLUGIN_FILE', __FILE__ ); +define( 'CONTENT_MODEL_PLUGIN_PATH', plugin_dir_path( __FILE__ ) ); +define( 'CONTENT_MODEL_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); +define( 'CONTENT_MODEL_PLUGIN_VER', '1.0.0' ); + +if ( ! function_exists( 'content_model_require_if_exists' ) ) { + /** + * Requires a file if it exists. + * + * @param string $file The file to require. + */ + function content_model_require_if_exists( string $file ) { + if ( file_exists( $file ) ) { + require_once $file; + } + } +} + +content_model_require_if_exists( __DIR__ . '/includes/json-initializer/0-load.php' ); +content_model_require_if_exists( __DIR__ . '/includes/runtime/0-load.php' ); \ No newline at end of file diff --git a/vendors/create-content-model/includes/.DS_Store b/vendors/create-content-model/includes/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..af79c16232d58b1a3d7fd54e4aebe060663e2c60 GIT binary patch literal 6148 zcmeHKyH3ME5S%5Eh(zO(@_vAVKR89<3-SYjBn8M|DUXKA9lxE~2azKSDHR3mN_*qm z+qspe@OlBr{J41p8UQo8BEEDPo1UwW>?R_LVs|{?6(95i{W?=_gE#EakvZf)qvb81 z*kZTYuiKZdYxT-o>~LhNmUzc@cywLG%t{4Pfm9$BNCp140_@ppvpdIJQ-M?<6*w!P z--kk1tbx6weLA?<2tb@NY{qAsC5S}>#2VN;GC~ul5}hhBVu;fjFOgRRdq<~3tTOM3 z$`TWbSarsWr9-M?uBkvOaH+t=w~hAyC;AWb|0OARsX!|5rxcLsV!4>}m7=$fUQT;$ up|9xQ##~G1Vy&2Ht(Y5a#rK1}qR%|9fxV;A88 json_decode( file_get_contents( $file ), true ), + $post_types + ); + + self::register_content_models_from_json( $post_types ); + self::delete_dangling_content_models( $post_types ); + $option['version'] = $plugin_data['Version']; + update_option( self::CREATE_CONTENT_MODEL_OPTION, $option ); + } + + /** + * Register the content models from JSON files. + * + * @param array $post_types The post types from the JSON files. + */ + private static function register_content_models_from_json( $post_types ) { + $content_models = self::group_content_models_by_slug(); + + foreach ( $post_types as $post_type ) { + + $content_model_post = array( + 'post_name' => $post_type['slug'], + 'post_title' => $post_type['label'], + 'post_status' => 'publish', + 'post_type' => Content_Model_Manager::POST_TYPE_NAME, + 'post_content' => serialize_blocks( $post_type['template'] ), + ); + + $existing_content_model = $content_models[ $post_type['slug'] ] ?? null; + + if ( $existing_content_model ) { + $content_model_post['ID'] = $existing_content_model->ID; + } + + $post_id = wp_insert_post( $content_model_post ); + + update_post_meta( $post_id, 'plural_label', $post_type['pluralLabel'] ); + update_post_meta( $post_id, 'icon', $post_type['icon'] ); + update_post_meta( $post_id, 'fields', wp_json_encode( $post_type['fields'] ) ); + } + } + + /** + * Deletes content models not included in the JSON files. + * + * @param array $post_types The post types from the JSON files. + * + * @return void + */ + private static function delete_dangling_content_models( $post_types ) { + $content_models = self::group_content_models_by_slug(); + $post_types = self::group_post_types_by_slug( $post_types ); + + foreach ( $content_models as $model_slug => $model ) { + if ( ! isset( $post_types[ $model_slug ] ) ) { + wp_delete_post( $model->ID, false ); + } + } + } + + /** + * Groups existing content models by their slug. + * + * @return array An array of content models, keyed by their slug. + */ + private static function group_content_models_by_slug() { + $models = Content_Model_Manager::get_content_models_from_database(); + + return array_reduce( + $models, + function ( $carry, $model ) { + $carry[ $model->post_name ] = $model; + return $carry; + }, + array() + ); + } + + /** + * Groups existing post types by their slug. + * + * @param array $post_types The post types from the JSON files. + * + * @return array An array of post types, keyed by their slug. + */ + private static function group_post_types_by_slug( $post_types ) { + return array_reduce( + $post_types, + function ( $carry, $post_type ) { + $carry[ $post_type['slug'] ] = $post_type; + return $carry; + }, + array() + ); + } +} diff --git a/vendors/create-content-model/includes/runtime/0-load.php b/vendors/create-content-model/includes/runtime/0-load.php new file mode 100644 index 0000000..0cba82a --- /dev/null +++ b/vendors/create-content-model/includes/runtime/0-load.php @@ -0,0 +1,17 @@ +block_name = $block['blockName']; + $this->content_model = $content_model; + $this->raw_block = $block; + + $metadata = $block['attrs']['metadata'] ?? array(); + + if ( empty( $metadata[ self::BLOCK_VARIATION_NAME_ATTR ] ) ) { + return; + } + + $this->block_variation_name = $metadata[ self::BLOCK_VARIATION_NAME_ATTR ]; + $this->block_variation_slug = sanitize_title_with_dashes( $this->block_variation_name ); + + if ( ! $this->content_model && ! empty( $metadata[ self::CONTENT_MODEL_SLUG_ATTR ] ) ) { + $content_model_slug = $metadata[ self::CONTENT_MODEL_SLUG_ATTR ]; + + $this->content_model = Content_Model_Manager::get_instance()->get_content_model_by_slug( $content_model_slug ); + } + + $this->bindings = $metadata['bindings'] ?? array(); + + /** + * If not instantiated directly by a content model, do not register hooks. + */ + if ( ! $content_model ) { + return; + } + + add_filter( 'get_block_type_variations', array( $this, 'register_block_variation' ), 10, 2 ); + + add_filter( 'pre_render_block', array( $this, 'render_group_variation' ), 99, 2 ); + } + + /** + * Retrieves the block variation name. + * + * @return string The block name. + */ + public function get_block_variation_name() { + return $this->block_variation_name; + } + + /** + * Retrieves the content model instance associated with this block. + * + * @return Content_Model The content model instance. + */ + public function get_content_model() { + return $this->content_model; + } + + /** + * Retrieves the underlying block name. + * + * @return string The block name. + */ + public function get_block_name() { + return $this->block_name; + } + + /** + * Retrieves the bindings for the Content_Model_Block instance. + * + * @return array The bindings for the block. + */ + public function get_bindings() { + return $this->bindings; + } + + /** + * Retrieves the value of a specific binding for the Content_Model_Block instance. + * + * @param string $binding_key The key of the binding to retrieve. + * @return mixed The value of the binding, or null if not found. + */ + public function get_binding( $binding_key ) { + return $this->bindings[ $binding_key ] ?? null; + } + + /** + * Register a block variations for this block. + * + * @param array $variations The existing block variations. + * @param WP_Block_Type $block_type The block type. + */ + public function register_block_variation( $variations, $block_type ) { + if ( $block_type->name !== $this->block_name || empty( $this->get_bindings() ) ) { + return $variations; + } + + $variation = array( + 'name' => sanitize_title( $this->block_variation_name ), + 'title' => $this->block_variation_name, + 'category' => $this->content_model->slug . '-blocks', + 'attributes' => array_merge( + $this->raw_block['attrs'], + array( + 'metadata' => array( + self::BLOCK_VARIATION_NAME_ATTR => $this->block_variation_name, + self::CONTENT_MODEL_SLUG_ATTR => $this->content_model->slug, + ), + ), + ), + ); + + if ( 'core/group' === $this->block_name ) { + $content_binding = $this->get_binding( 'content' ); + + if ( ! $content_binding ) { + return $variations; + } + + $variation['innerBlocks'] = array( + array( + 'core/paragraph', + array( + 'content' => $content_binding['args']['key'], + ), + ), + ); + } + + $variation['attributes']['metadata']['bindings'] = $this->get_bindings(); + + $variations[] = $variation; + + return $variations; + } + + /** + * Since there are no official bindings for group variations and its inner blocks, + * we need to inject the inner blocks and HTML ourselves. + * + * @param string|null $pre_render The pre-rendered content. + * @param array $parsed_block The current parsed block. + * + * @return string|null The rendered block. + */ + public function render_group_variation( $pre_render, $parsed_block ) { + $tentative_block = new Content_Model_Block( $parsed_block ); + + if ( $tentative_block->get_block_variation_name() !== $this->block_variation_name ) { + return $pre_render; + } + + if ( $tentative_block->get_block_name() !== 'core/group' ) { + return $pre_render; + } + + $hydrator = new Content_Model_Data_Hydrator( array( $parsed_block ), true ); + + remove_filter( 'pre_render_block', array( $this, 'render_group_variation' ), 99 ); + + // Accessing index zero because we've passed an array with one element above. + $result = render_block( $hydrator->hydrate()[0] ); + + add_filter( 'pre_render_block', array( $this, 'render_group_variation' ), 99, 2 ); + + return $result; + } + + /** + * Returns the metadata for an attribute. + * + * @param string $attribute_name The attribute. + * + * @return array The metadata. + */ + public function get_attribute_metadata( $attribute_name ) { + $block_metadata = WP_Block_Type_Registry::get_instance()->get_registered( $this->get_block_name() ); + $block_attributes = $block_metadata->get_attributes(); + + if ( isset( $block_attributes[ $attribute_name ] ) ) { + return $block_attributes[ $attribute_name ]; + } + + if ( 'core/group' === $this->get_block_name() && 'content' === $attribute_name ) { + return array( + 'source' => 'rich-text', + 'selector' => 'div', + ); + } + } + + /** + * Get the type of an attribute, according to our case handling. + * + * @param string $attribute_name The name of the attribute. + * + * @return string The type of the attribute. + */ + public function get_attribute_type( $attribute_name ) { + $block_attribute = $this->get_attribute_metadata( $attribute_name ); + + $block_attribute_type = $block_attribute['type'] ?? 'string'; + + if ( ! in_array( $block_attribute_type, array( 'integer', 'number', 'boolean' ), true ) ) { + $block_attribute_type = 'string'; + } + + return $block_attribute_type; + } + + /** + * Get the default value from an attribute in the template. + * + * @param string $attribute_name The attribute name. + * + * @return mixed The default value. + */ + public function get_default_value_for_attribute( $attribute_name ) { + $block_attribute = $this->raw_block['attrs'][ $attribute_name ] ?? null; + + if ( $block_attribute ) { + return $block_attribute; + } + + if ( 'content' === $attribute_name && 'core/group' === $this->block_name ) { + return serialize_blocks( $this->raw_block['innerBlocks'] ); + } + + $attribute_metadata = $this->get_attribute_metadata( $attribute_name ); + + if ( isset( $attribute_metadata['source'] ) ) { + $html_manipulator = new Content_Model_Html_Manipulator( $this->raw_block['innerHTML'] ); + + $attribute_value = $html_manipulator->extract_attribute( $attribute_metadata ); + + if ( $attribute_value ) { + return $attribute_value; + } + } + } +} diff --git a/vendors/create-content-model/includes/runtime/class-content-model-data-hydrator.php b/vendors/create-content-model/includes/runtime/class-content-model-data-hydrator.php new file mode 100644 index 0000000..0b6dfdd --- /dev/null +++ b/vendors/create-content-model/includes/runtime/class-content-model-data-hydrator.php @@ -0,0 +1,107 @@ +blocks = $blocks; + + $this->strip_attribute_metadata = $strip_attribute_metadata; + } + + /** + * Fills the bound attributes with content from the post. + * + * @return array The template blocks, filled with data. + */ + public function hydrate() { + return content_model_block_walker( + $this->blocks, + array( $this, 'hydrate_block' ) + ); + } + + /** + * Hydrates a block with information from the post. + * + * @param array $block The block. + * + * @return array The hydrated block. + */ + public function hydrate_block( $block ) { + $block['attrs']['lock'] = array( + 'move' => true, + 'remove' => true, + ); + + $content_model_block = new Content_Model_Block( $block ); + + if ( 'core/group' !== $content_model_block->get_block_name() ) { + return $block; + } + + $binding = $content_model_block->get_binding( 'content' ); + + if ( ! $binding ) { + return $block; + } + + $field = $binding['args']['key']; + + if ( 'post_content' === $field ) { + $content = get_the_content(); + } else { + $content = get_post_meta( get_the_ID(), $field, true ); + } + + // If can't find the content, do not try to inject it. + if ( ! $content ) { + return $block; + } + + if ( $this->strip_attribute_metadata ) { + $content = implode( + '', + array_map( fn( $block ) => render_block( $block ), parse_blocks( $content ) ) + ); + } + + $html_handler = new Content_Model_Html_Manipulator( $block['innerHTML'] ); + + $block_attribute = $content_model_block->get_attribute_metadata( 'content' ); + + $block['innerHTML'] = $html_handler->replace_attribute( $block_attribute, $content ); + $block['innerContent'] = array( $block['innerHTML'] ); + + return $block; + } +} diff --git a/vendors/create-content-model/includes/runtime/class-content-model-html-manipulator.php b/vendors/create-content-model/includes/runtime/class-content-model-html-manipulator.php new file mode 100644 index 0000000..0538eab --- /dev/null +++ b/vendors/create-content-model/includes/runtime/class-content-model-html-manipulator.php @@ -0,0 +1,151 @@ +loadXML( $markup, LIBXML_NOXMLDECL ); + + $this->dom = $dom; + } + + /** + * Extract attribute value from the markup. + * + * @param array $attribute_metadata The attribute metadata from the block.json file. + * + * @return mixed|null The attribute value. + */ + public function extract_attribute( $attribute_metadata ) { + $matches = $this->get_matches( $attribute_metadata['selector'] ); + + if ( ! $matches ) { + return null; + } + + foreach ( $matches as $match ) { + if ( $match instanceof \DOMElement ) { + if ( 'attribute' === $attribute_metadata['source'] ) { + return $match->getAttribute( $attribute_metadata['attribute'] ); + } + + return implode( + '', + array_map( + // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase + fn( $node ) => $node->ownerDocument->saveXML( $node ), + // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase + iterator_to_array( $match->childNodes ), + ) + ); + } + } + + return null; + } + + /** + * Replace attribute value in the markup. + * + * @param array $attribute_metadata The attribute metadata from the block.json file. + * @param mixed $attribute_value The attribute value. + * + * @return string The updated markup. + */ + public function replace_attribute( $attribute_metadata, $attribute_value ) { + $matches = $this->get_matches( $attribute_metadata['selector'] ); + + foreach ( $matches as $match ) { + if ( $match instanceof \DOMElement ) { + if ( 'attribute' === $attribute_metadata['source'] ) { + $attribute = $attribute_metadata['attribute']; + $value = $match->getAttribute( $attribute ); + + if ( 'class' === $attribute ) { + $value .= ' ' . $attribute_value; + } else { + $value = $attribute_value; + } + + $match->setAttribute( $attribute, $value ); + } else { + self::swap_element_inner_html( $match, $attribute_value ); + } + } + } + + return $this->get_markup(); + } + + /** + * Returns matches for a given selector. + * + * @param string $selector The selector. + * + * @return DOMNodeList|false + */ + private function get_matches( $selector ) { + $xpath = new DOMXPath( $this->dom ); + + $query = '(//*'; + + foreach ( explode( ',', $selector ) as $possible_selector ) { + $query .= ' | ' . $possible_selector; + } + + $query .= ')[last()]'; + + return $xpath->query( $query ); + } + + /** + * Returns the markup associated with the DOMDocument instance. + * + * @return string + */ + private function get_markup() { + return $this->dom->saveXML( $this->dom->documentElement, LIBXML_NOXMLDECL ); + } + + /** + * Swap the node's innerHTML with the given HTML. + * + * @param \DOMElement $node The HTML node. + * @param string $html The desired inner HTML. + * + * @return void + */ + private static function swap_element_inner_html( $node, $html ) { + // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase + $fragment = $node->ownerDocument->createDocumentFragment(); + $fragment->appendXML( $html ); + + while ( $node->hasChildNodes() ) { + // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase + $node->removeChild( $node->firstChild ); + } + + $node->appendChild( $fragment ); + } +} diff --git a/vendors/create-content-model/includes/runtime/class-content-model-manager.php b/vendors/create-content-model/includes/runtime/class-content-model-manager.php new file mode 100644 index 0000000..0ac56f7 --- /dev/null +++ b/vendors/create-content-model/includes/runtime/class-content-model-manager.php @@ -0,0 +1,99 @@ +register_content_models(); + } + + /** + * Retrieves the registered content models. + * + * @return Content_Model[] An array of registered content models. + */ + public function get_content_models() { + return $this->content_models; + } + + /** + * Retrieves a content model by its slug. + * + * @param string $slug The slug of the content model to retrieve. + * @return Content_Model|null The content model with the matching slug, or null if not found. + */ + public function get_content_model_by_slug( $slug ) { + foreach ( $this->content_models as $content_model ) { + if ( $slug === $content_model->slug ) { + return $content_model; + } + } + + return null; + } + + /** + * Registers all content models. + * + * @return void + */ + private function register_content_models() { + $content_models = self::get_content_models_from_database(); + + foreach ( $content_models as $content_model ) { + $this->content_models[] = new Content_Model( $content_model ); + } + } + + /** + * Retrieves the list of registered content models. + * + * @return WP_Post[] An array of WP_Post objects representing the registered content models. + */ + public static function get_content_models_from_database() { + return get_posts( array( 'post_type' => self::POST_TYPE_NAME ) ); + } +} diff --git a/vendors/create-content-model/includes/runtime/class-content-model.php b/vendors/create-content-model/includes/runtime/class-content-model.php new file mode 100644 index 0000000..3a28165 --- /dev/null +++ b/vendors/create-content-model/includes/runtime/class-content-model.php @@ -0,0 +1,612 @@ +slug = $content_model_post->post_name; + $this->title = $content_model_post->post_title; + $this->template = parse_blocks( $content_model_post->post_content ); + $this->post_id = $content_model_post->ID; + + $this->register_post_type(); + + // TODO: Not load this eagerly. + //$this->blocks = $this->inflate_template_blocks( $this->template ); + $this->fields = $this->parse_fields(); + $this->register_meta_fields(); + + //add_action( 'enqueue_block_editor_assets', array( $this, 'maybe_enqueue_templating_scripts' ) ); + add_action( 'enqueue_block_editor_assets', array( $this, 'maybe_enqueue_data_entry_scripts' ) ); + + add_filter( 'block_categories_all', array( $this, 'register_block_category' ) ); + + add_filter( 'rest_request_before_callbacks', array( $this, 'remove_default_meta_keys_on_save' ), 10, 3 ); + //add_filter( 'rest_post_dispatch', array( $this, 'fill_empty_meta_keys_with_default_values' ), 10, 3 ); + + //add_action( 'rest_after_insert_' . $this->slug, array( $this, 'extract_post_content_from_blocks' ), 99, 1 ); + + /** + * We need two different hooks here because the Editor and the front-end read from different sources. + * + * The Editor reads the whole post, while the front-end reads only the post content. + */ + //add_action( 'the_post', array( $this, 'hydrate_bound_groups' ) ); + //add_filter( 'the_content', array( $this, 'swap_post_content_with_hydrated_template' ) ); + + add_filter( 'get_post_metadata', array( $this, 'cast_meta_field_types' ), 10, 3 ); + } + + /** + * Retrieves the plural label for the content model. + * + * If the plural label is not set, it will default to the singular label with an 's' appended. + * + * @return string The plural label. + */ + public function get_plural_label() { + return $this->get_model_meta( 'plural_label' ) ?? "{$this->title}s"; + } + + /** + * Retrieves the icon for the content model. + * + * If the icon is not set, it will default to 'admin-post'. + * + * @return string The icon slug. + */ + public function get_icon() { + $icon = $this->get_model_meta( 'icon' ) ?? 'admin-post'; + + return str_replace( 'dashicons-', '', $icon ); + } + + /** + * Retrieves a meta value for the content model. + * + * @param string $key The meta key to retrieve. + * @return mixed The value of the meta field, or null if it does not exist. + */ + private function get_model_meta( $key ) { + $meta = get_post_meta( $this->post_id, $key, true ); + + if ( ! empty( $meta ) ) { + return $meta; + } + + return null; + } + + /** + * Registers the custom post type for the content model. + * + * @return void + */ + private function register_post_type() { + $singular_name = $this->title; + $plural_name = $this->get_plural_label(); + + $labels = array( + 'name' => $plural_name, + 'singular_name' => $singular_name, + 'menu_name' => $plural_name, + // translators: %s is the plural name of the post type. + 'all_items' => sprintf( __( 'All %s' ), $plural_name ), + // translators: %s is the singular name of the post type. + 'add_new' => sprintf( __( 'Add New %s' ), $singular_name ), + // translators: %s is the singular name of the post type. + 'add_new_item' => sprintf( __( 'Add New %s' ), $singular_name ), + // translators: %s is the singular name of the post type. + 'edit_item' => sprintf( __( 'Edit %s' ), $singular_name ), + // translators: %s is the singular name of the post type. + 'new_item' => sprintf( __( 'New %s' ), $singular_name ), + // translators: %s is the singular name of the post type. + 'view_item' => sprintf( __( 'View %s' ), $singular_name ), + // translators: %s is the plural name of the post type. + 'search_items' => sprintf( __( 'Search %s' ), $plural_name ), + // translators: %s is the plural name of the post type. + 'not_found' => sprintf( __( 'No %s found' ), $plural_name ), + // translators: %s is the plural name of the post type. + 'not_found_in_trash' => sprintf( __( 'No %s found in trash' ), $plural_name ), + ); + + $post_type_args = array( + 'labels' => $labels, + 'public' => true, + 'show_in_menu' => true, + 'has_archive' => sanitize_key( $plural_name ), + 'show_in_rest' => true, + 'menu_icon' => "dashicons-{$this->get_icon()}", + 'supports' => array( 'title', 'slug', 'excerpt', 'editor', 'custom-fields','thumbnail' ), + ); + + if ( 'destination' === $this->slug ) { + $post_type_args['hierarchical'] = true; + $post_type_args['supports'][] = 'page-attributes'; + } + + register_post_type( + $this->slug, + $post_type_args + ); + } + + /** + * Parses the fields associated with the Content Model. + * + * @return array Fields associated with the Content Model. + */ + private function parse_fields() { + $fields = get_post_meta( $this->post_id, 'fields', true ); + if ( ! $fields ) { + return array(); + } + + $decoded_files = json_decode( $fields, true ); + + if ( is_array( $decoded_files ) ) { + return $decoded_files; + } + + return array(); + } + + + /** + * Recursively inflates (i.e., maps the block into Content_Model_Block) the blocks. + * + * @param array $blocks The template blocks to inflate. + * @return Content_Model_Block[] The Content_Model_Block instances. + */ + private function inflate_template_blocks( $blocks ) { + $acc = array(); + + content_model_block_walker( + $blocks, + function ( $block ) use ( &$acc ) { + $content_model_block = new Content_Model_Block( $block, $this ); + + if ( empty( $content_model_block->get_bindings() ) ) { + return $block; + } + + $acc[ $content_model_block->get_block_variation_name() ] = $content_model_block; + + return $block; + } + ); + + return $acc; + } + + /** + * Registers meta fields for the content model. + * + * @return void + */ + private function register_meta_fields() { + + if ( ! empty( $this->fields ) ) { + foreach ( $this->fields as $field ) { + if ( strpos( $field['type'], 'core' ) !== false ) { + continue; + } + + switch ( $field['type'] ) { + case 'multiselect'; + $type = 'string'; + $single = false; + break; + + default; + $type = 'string'; + $single = true; + break; + } + + register_post_meta( + $this->slug, + $field['slug'], + array( + 'description' => $field['description'], + 'show_in_rest' => true, + 'single' => $single, + 'type' => $type, // todo: support other types. + ) + ); + } + } + + /*foreach ( $this->blocks as $block ) { + foreach ( $block->get_bindings() as $attribute_name => $binding ) { + $field = $binding['args']['key']; + + if ( 'post_content' === $field ) { + continue; + } + + $this->bound_meta_keys[ $field ] = (object) array( + 'block' => $block, + 'attribute_name' => $attribute_name, + ); + + $args = array( + 'show_in_rest' => true, + 'single' => true, + 'type' => $block->get_attribute_type( $attribute_name ), + ); + + $default_value = $block->get_default_value_for_attribute( $attribute_name ); + + if ( ! empty( $default_value ) ) { + $args['default'] = $default_value; + } + + register_post_meta( + $this->slug, + $field, + $args + ); + } + }*/ + } + + /** + * Retrieves a list of meta fields registered for the content model. + * + * @return array An array of registered meta field keys. + */ + public function get_meta_fields() { + $registered_meta_fields = get_registered_meta_keys( 'post', $this->slug ); + + $result = array(); + + foreach ( $registered_meta_fields as $meta_field => $meta_field_data ) { + $result[] = array( + 'slug' => $meta_field, + 'type' => $meta_field_data['type'], + 'description' => $meta_field_data['description'], + ); + } + + return $result; + } + + /** + * Casts meta field types for the content model. The values are saved as strings, + * so we need to cast them back to their original type. Not sure why WordPress doesn't + * do that already. + * + * @param mixed $value The value coming from the database. + * @param int $object_id The post ID. + * @param string $meta_key The meta key. + * + * @return mixed The casted value, if applicable. The original value otherwise. + */ + public function cast_meta_field_types( $value, $object_id, $meta_key ) { + $meta_field_type = get_registered_meta_keys( 'post', $this->slug )[ $meta_key ]['type'] ?? null; + + if ( ! $meta_field_type ) { + return $value; + } + + if ( 'integer' === $meta_field_type ) { + return (int) $value; + } + + if ( 'number' === $meta_field_type ) { + return (float) $value; + } + + if ( 'boolean' === $meta_field_type ) { + return (bool) $value; + } + + return $value; + } + + /** + * Register the block category, which will be used by Content_Model_Block to group block variations. + * + * @param array $categories The existing block categories. + */ + public function register_block_category( $categories ) { + $categories[] = array( + 'slug' => $this->slug . '-blocks', + // translators: %s is content model name. + 'title' => sprintf( __( '%s blocks' ), ucwords( $this->title ) ), + ); + + return $categories; + } + + /** + * Finds the post_content content area within blocks. + * + * @param WP_Post $post The post. + */ + public function extract_post_content_from_blocks( $post ) { + if ( 'publish' !== $post->post_status ) { + return; + } + + $blocks = parse_blocks( wp_unslash( $post->post_content ) ); + + wp_update_post( + array( + 'ID' => $post->ID, + 'post_content' => self::get_post_content( $blocks ) ?? '', + ) + ); + } + + /** + * Intercepts the saving request and removes the meta keys with default values. + * + * @param WP_HTTP_Response|null $response The response. + * @param WP_REST_Server $server Route handler used for the request. + * @param WP_REST_Request $request The request. + * + * @return WP_REST_Response The response. + */ + public function remove_default_meta_keys_on_save( $response, $server, $request ) { + $is_upserting = in_array( $request->get_method(), array( 'POST', 'PUT' ), true ); + $is_touching_post_type = str_starts_with( $request->get_route(), '/wp/v2/' . $this->slug ); + + if ( $is_upserting && $is_touching_post_type ) { + $meta = $request->get_param( 'meta' ) ?? array(); + + foreach ( $meta as $key => $value ) { + if ( '' === $value ) { + unset( $meta[ $key ] ); + delete_post_meta( $request->get_param( 'id' ), $key ); + } + } + + $request->set_param( 'meta', $meta ); + } + + return $response; + } + + /** + * Intercepts the response and fills the empty meta keys with default values. + * + * @param WP_HTTP_Response $result The response. + * @param WP_REST_Server $server The server. + * @param WP_REST_Request $request The request. + * + * @return WP_REST_Response The response. + */ + public function fill_empty_meta_keys_with_default_values( $result, $server, $request ) { + $is_allowed_method = in_array( $request->get_method(), array( 'GET', 'POST', 'PUT' ), true ); + $is_touching_post_type = str_starts_with( $request->get_route(), '/wp/v2/' . $this->slug ); + + if ( $is_allowed_method && $is_touching_post_type ) { + $data = $result->get_data(); + + $data['meta'] ??= array(); + + foreach ( $data['meta'] as $key => $value ) { + $bound_meta_key = $this->bound_meta_keys[ $key ] ?? null; + + if ( empty( $value ) && $bound_meta_key ) { + // TODO: Switch to empty string when Gutenberg 19.2 gets released. + $data['meta'][ $key ] = self::FALLBACK_VALUE_PLACEHOLDER; + } + } + + $result->set_data( $data ); + } + + return $result; + } + /** + * Extracts the post content from the blocks. + * + * @param array $blocks The blocks. + * + * @return string The post content. + */ + private static function get_post_content( $blocks ) { + $post_content = content_model_block_walker( + $blocks, + function ( $block ) { + if ( 'core/group' !== $block['blockName'] ) { + return $block; + } + + $content_model_block = new Content_Model_Block( $block ); + $content_binding = $content_model_block->get_binding( 'content' ); + + if ( $content_binding && 'post_content' === $content_binding['args']['key'] ) { + return serialize_blocks( $block['innerBlocks'] ); + } + + return $block; + }, + false // Breadth-first because it's more likely that post content will be at the top level. + ); + + if ( ! is_string( $post_content ) ) { + return null; + } + + return $post_content; + } + + /** + * In the editor, display the template and fill bound Groups with data. + * Blocks using the supported Bindings API attributes will be filled automatically. + * + * @param WP_Post $post The current post. + */ + public function hydrate_bound_groups( $post ) { + if ( $this->slug !== $post->post_type ) { + return; + } + + $editor_blocks = $this->template; + $editor_blocks = ( new Content_Model_Data_Hydrator( $editor_blocks, false ) )->hydrate(); + $editor_blocks = content_model_block_walker( $editor_blocks, array( $this, 'add_fallback_value_placeholder' ) ); + + $post->post_content = serialize_blocks( $editor_blocks ); + } + + /** + * If a block has bindings modify the placeholder text. + * + * @param array $block The original block. + * + * @return array The modified block. + */ + public function add_fallback_value_placeholder( $block ) { + $tentative_block = new Content_Model_Block( $block ); + + if ( ! empty( $tentative_block->get_bindings() ) ) { + // translators: %s is the block variation name. + $block['attrs']['placeholder'] = sprintf( __( 'Enter a value for %s' ), $tentative_block->get_block_variation_name() ); + + return $block; + } + + return $block; + } + + /** + * In the front-end, swap the post_content with the hydrated template. + * + * @param string $post_content The current post content. + */ + public function swap_post_content_with_hydrated_template( $post_content ) { + global $post; + + if ( $this->slug !== $post->post_type ) { + return $post_content; + } + + return implode( '', array_map( fn( $block ) => render_block( $block ), $this->template ) ); + } + + /** + * Enqueue the data entry helper scripts. + * + * @return void + */ + public function maybe_enqueue_data_entry_scripts() { + global $post; + + if ( ! $post || $this->slug !== $post->post_type ) { + return; + } + + $asset_file = include CONTENT_MODEL_PLUGIN_PATH . 'includes/runtime/dist/data-entry.asset.php'; + + wp_enqueue_script( + 'content-model/data-entry', + CONTENT_MODEL_PLUGIN_URL . '/includes/runtime/dist/data-entry.js', + $asset_file['dependencies'], + $asset_file['version'], + true + ); + + wp_localize_script( + 'content-model/data-entry', + 'contentModelData', + array( + 'POST_TYPE' => $this->slug, + 'FIELDS' => $this->fields, + 'FALLBACK_VALUE_PLACEHOLDER' => self::FALLBACK_VALUE_PLACEHOLDER, + ) + ); + } + + /** + * Enqueue the templating helper scripts. + * + * @return void + */ + public function maybe_enqueue_templating_scripts() { + $current_screen = get_current_screen(); + + if ( 'site-editor' !== $current_screen->id ) { + return; + } + + $asset_file = include CONTENT_MODEL_PLUGIN_PATH . 'includes/runtime/dist/templating.asset.php'; + + wp_enqueue_script( + 'content-model/templating', + CONTENT_MODEL_PLUGIN_URL . '/includes/runtime/dist/templating.js', + $asset_file['dependencies'], + $asset_file['version'], + true + ); + } +} diff --git a/vendors/create-content-model/includes/runtime/dist/data-entry.asset.php b/vendors/create-content-model/includes/runtime/dist/data-entry.asset.php new file mode 100644 index 0000000..b980f50 --- /dev/null +++ b/vendors/create-content-model/includes/runtime/dist/data-entry.asset.php @@ -0,0 +1 @@ + array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => '13c8c5827a94c5569d3e'); diff --git a/vendors/create-content-model/includes/runtime/dist/data-entry.js b/vendors/create-content-model/includes/runtime/dist/data-entry.js new file mode 100644 index 0000000..53ca709 --- /dev/null +++ b/vendors/create-content-model/includes/runtime/dist/data-entry.js @@ -0,0 +1,298 @@ +(() => { + "use strict"; + + const plugins = window.wp.plugins; + const element = window.wp.element; + const coreData = window.wp.coreData; + const data = window.wp.data; + const blockEditor = window.wp.blockEditor; + const blocks = window.wp.blocks; + + const { + POST_TYPE, + FIELDS, + FALLBACK_VALUE_PLACEHOLDER + } = window.contentModelData; + + // Function to serialize inner blocks + const serializeInnerBlocks = (blocks, metadata = {}) => { + for (const block of blocks) { + if ("core/group" !== block.name) continue; + + const key = block.attributes.metadata?.bindings?.content?.args?.key; + + if (key && "post_content" !== key) { + metadata[key] = blocks.serialize(block.innerBlocks); + } + + if (block.innerBlocks.length > 0) { + metadata = serializeInnerBlocks(block.innerBlocks, metadata); + } + } + return metadata; + }; + + // List of supported block types with their respective attributes + const supportedBlockTypes = Object.keys({ + "core/group": ["content"], + "core/paragraph": ["content"], + "core/heading": ["content"], + "core/image": ["id", "url", "title", "alt"], + "core/button": ["url", "text", "linkTarget", "rel"] + }); + + // Function to update block editing mode + const updateBlockEditingMode = (blocks, setBlockEditingMode, recursive = false) => { + blocks.forEach((block) => { + if (block.innerBlocks.length > 0 && block.attributes.metadata?.bindings) { + setBlockEditingMode(block.clientId, "default"); + + if (block.innerBlocks) { + updateBlockEditingMode(block.innerBlocks, setBlockEditingMode, true); + } + } else if (block.innerBlocks.length > 0) { + findEditableGroup(block.innerBlocks) || ( + data.dispatch("core/block-editor").updateBlock(block.clientId, { + ...block, + attributes: { ...block.attributes, templateLock: "contentOnly" } + }), + setBlockEditingMode(block.clientId, "disabled") + ); + + if (block.innerBlocks) { + updateBlockEditingMode(block.innerBlocks, setBlockEditingMode); + } + } else if ( + supportedBlockTypes.includes(block.name) && + block.attributes.metadata?.bindings || + recursive + ) { + setBlockEditingMode(block.clientId, ""); + } else { + setBlockEditingMode(block.clientId, "disabled"); + } + }); + }; + + // Recursive function to find an editable group block + const findEditableGroup = (blocks) => { + for (const block of blocks) { + if ("core/group" === block.name && block.attributes.metadata?.bindings) { + return block; + } + + if (block.innerBlocks.length > 0) { + const foundBlock = findEditableGroup(block.innerBlocks); + if (foundBlock) return foundBlock; + } + } + + return null; + }; + + const React = window.React; + const editor = window.wp.editor; + const components = window.wp.components; + const i18n = window.wp.i18n; + + // UI Components + const FieldsUI = ({ fields }) => ( + React.createElement(components.__experimentalVStack, null, + fields.filter(field => field.visible).map(field => + React.createElement(Field, { key: field.slug, field }) + ) + ) + ); + + const Field = ({ field }) => { + const [meta, setMeta] = coreData.useEntityProp("postType", POST_TYPE, "meta"); + const value = meta[field.slug] !== null && meta[field.slug] !== undefined ? meta[field.slug] : ''; + return React.createElement("div", null, + React.createElement(FieldInput, { + field, + value, + saveChanges: (slug, newValue) => { setMeta({ [slug]: newValue }); } + }), + React.createElement("small", null, React.createElement("em", null, field.description)) + ); + }; + + const FieldInput = ({ field, isDisabled = false, value, saveChanges }) => { + if (field.type === "image") { + return React.createElement(React.Fragment, null, + React.createElement("span", { + style: { + textTransform: "uppercase", + fontSize: "11px", + marginBottom: "calc(8px)", + fontWeight: "500" + } + }, field.label), + !value && React.createElement(blockEditor.MediaPlaceholder, { + allowedTypes: ["image"], + accept: "image", + multiple: false, + onSelect: (media) => saveChanges(field.slug, media.url) + }), + value && React.createElement(components.Card, null, + React.createElement(components.CardBody, null, + React.createElement("img", { src: value, alt: field.label, style: { width: "100%" } }) + ), + React.createElement(components.CardFooter, null, + React.createElement(components.Button, { + isDestructive: true, + onClick: () => saveChanges(field.slug, "") + }, i18n.__("Remove Image")) + ) + ) + ); + } + + if (field.type === "textarea") { + return React.createElement(components.TextareaControl, { + label: field.label, + readOnly: isDisabled, + value, + onChange: (newValue) => saveChanges(field.slug, newValue) + }); + } + + if (field.type === "multiselect") { + return React.createElement(components.SelectControl, { + multiple: true, + label: field.label, + readOnly: isDisabled, + //selectedValues: value, // Assuming `value` is an array of selected values + value, + options: field.options, // Assuming `field.options` contains the available options + onChange: (selectedOptions ) => saveChanges(field.slug, selectedOptions), + }); + } + + if (field.type === "select") { + return React.createElement(components.ComboboxControl, { + //multiple: true, + label: field.label, + readOnly: isDisabled, + //selectedValues: value, // Assuming `value` is an array of selected values + value, + options: field.options, // Assuming `field.options` contains the available options + onChange: (selectedOptions ) => saveChanges(field.slug, selectedOptions), + }); + } + + return React.createElement(components.TextControl, { + label: field.label, + type: field.type, + readOnly: isDisabled, + value, + onChange: (newValue) => saveChanges(field.slug, newValue) + }); + }; + + // Registering Plugins + plugins.registerPlugin("create-content-model-bound-group-extractor", { + render: () => { + (() => { + const blocks = data.useSelect((select) => select(blockEditor.store).getBlocks()); + const [, setMeta] = coreData.useEntityProp("postType", POST_TYPE, "meta"); + + element.useEffect(() => { + const metadata = serializeInnerBlocks(blocks); + + if (Object.keys(metadata).length !== 0) { + setMeta(metadata); + } + }, [blocks, setMeta]); + })(); + } + }); + + plugins.registerPlugin("create-content-model-fields-ui", { + render: function() { + const [isOpen, setOpen] = element.useState(false); + return FIELDS.filter(field => field.visible).length === 0 ? null : + React.createElement(editor.PluginDocumentSettingPanel, { + name: "create-content-model-page-settings", + title: i18n.__("Custom Fields"), + className: "create-content-model-page-settings" + }, + React.createElement(components.__experimentalVStack, null, + React.createElement(FieldsUI, { fields: FIELDS }), + React.createElement(components.Button, { + variant: "secondary", + onClick: () => setOpen(true) + }, i18n.__("Expand Fields")) + ), + isOpen && React.createElement(components.Modal, { + title: i18n.__("Manage Fields"), + size: "large", + onRequestClose: () => setOpen(false) + }, + React.createElement(FieldsUI, { fields: FIELDS }) + ) + ); + } + }); + + /*plugins.registerPlugin("create-content-model-content-locking", { + render: () => { + (() => { + const blocks = wp.data.select("core/block-editor").getBlocks(); + const selectedBlock = wp.data.select("core/block-editor").getSelectedBlock(); + const { setBlockEditingMode } = data.useDispatch(blockEditor.store); + + element.useEffect(() => { + if (blocks.length > 0) { + updateBlockEditingMode(blocks, setBlockEditingMode); + } + }, [blocks, setBlockEditingMode, selectedBlock]); + })(); + } + });*/ + + plugins.registerPlugin("create-content-model-fallback-value-clearer", { + render: () => { + (() => { + const [meta, setMeta] = coreData.useEntityProp("postType", POST_TYPE, "meta"); + + const bindingsMap = data.useSelect((select) => { + const blocks = select(blockEditor.store).getBlocks(); + const map = {}; + + const processBlock = (block) => { + const bindings = block.attributes?.metadata?.bindings || {}; + + Object.entries(bindings).forEach(([_, binding]) => { + if (binding.source === "core/post-meta") { + map[block.clientId] || (map[block.clientId] = []); + map[block.clientId].push({ + metaKey: binding.args.key, + blockName: block.attributes.metadata.name + }); + } + }); + + if (block.innerBlocks && block.innerBlocks.length > 0) { + block.innerBlocks.forEach(processBlock); + } + }; + + blocks.forEach(processBlock); + return map; + }, []); + + element.useLayoutEffect(() => { + Object.entries(bindingsMap).forEach(([, bindings]) => { + bindings.forEach(({ metaKey }) => { + if (meta[metaKey] === FALLBACK_VALUE_PLACEHOLDER) { + setMeta({ [metaKey]: "" }); + } + }); + }); + }, [meta, setMeta, bindingsMap]); + })(); + } + }); + +})(); diff --git a/vendors/create-content-model/includes/runtime/dist/templating.asset.php b/vendors/create-content-model/includes/runtime/dist/templating.asset.php new file mode 100644 index 0000000..10f069e --- /dev/null +++ b/vendors/create-content-model/includes/runtime/dist/templating.asset.php @@ -0,0 +1 @@ + array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => 'c2269ddd80f70bbf5f1a'); diff --git a/vendors/create-content-model/includes/runtime/dist/templating.js b/vendors/create-content-model/includes/runtime/dist/templating.js new file mode 100644 index 0000000..80a0352 --- /dev/null +++ b/vendors/create-content-model/includes/runtime/dist/templating.js @@ -0,0 +1 @@ +(()=>{"use strict";const e=window.React,t=window.wp.hooks,a=window.wp.compose,n=window.wp.blockEditor,o=window.wp.blocks,l=window.wp.element,i=window.wp.components,r=window.wp.i18n,s=({name:t,attributes:a,setAttributes:s})=>{const c=(0,l.useMemo)((()=>(0,o.getBlockVariations)(t).find((e=>{return t=e.attributes,n=a,t.metadata&&n.metadata&&t.metadata.name===n.metadata.name&&t.metadata.content_model_slug===n.metadata.content_model_slug;var t,n}))),[t,a]);return(0,e.createElement)(n.InspectorControls,null,(0,e.createElement)(i.PanelBody,{title:"Content Model",initialOpen:!0},(0,e.createElement)(i.BaseControl,{__nextHasNoMarginBottom:!0,className:"edit-site-push-changes-to-global-styles-control",help:(0,r.__)("Updates this block variation to use the latest version from the content model.")},(0,e.createElement)(i.BaseControl.VisualLabel,null,(0,r.__)("Sync variation")),(0,e.createElement)(i.Button,{__next40pxDefaultSize:!0,variant:"secondary",accessibleWhenDisabled:!0,disabled:!c,onClick:()=>{s(c.attributes)}},(0,r.__)("Sync variation")))))},c=(0,a.createHigherOrderComponent)((t=>a=>{var n;const{name:o,content_model_slug:l}=null!==(n=a.attributes.metadata)&&void 0!==n?n:{},i=o&&l;return(0,e.createElement)(e.Fragment,null,i&&(0,e.createElement)(s,{...a}),(0,e.createElement)(t,{...a}))}),"withBlockVariationUpdater");(0,t.addFilter)("editor.BlockEdit","content-model/block-variation-updater",c)})(); \ No newline at end of file diff --git a/vendors/create-content-model/includes/runtime/helpers.php b/vendors/create-content-model/includes/runtime/helpers.php new file mode 100644 index 0000000..6e76e63 --- /dev/null +++ b/vendors/create-content-model/includes/runtime/helpers.php @@ -0,0 +1,49 @@ + Date: Wed, 29 Jan 2025 11:40:20 +0200 Subject: [PATCH 04/17] Removing the additional post types. --- post-types/destination.json | 80 --------------------------- post-types/tour.json | 107 ------------------------------------ vendors/.DS_Store | Bin 6148 -> 6148 bytes 3 files changed, 187 deletions(-) delete mode 100644 post-types/destination.json delete mode 100644 post-types/tour.json diff --git a/post-types/destination.json b/post-types/destination.json deleted file mode 100644 index 9f0afe7..0000000 --- a/post-types/destination.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "type": "postType", - "postType": "destination", - "slug": "destination", - "label": "Destination", - "pluralLabel": "Destinations", - "icon": "admin-site", - "hasArchive": "destination", - "hierarchical": true, - "showInRest": true, - "showInMenu": "tour-operator", - "menuPosition": 30, - "template": [], - "fields": [ - { - "slug": "tagline", - "type": "string", - "label": "Tagline", - "description": "", - "visible": true - }, - { - "slug": "best_time_to_visit", - "type": "multiselect", - "label": "Best time to visit", - "description": "", - "visible": true, - "options": [ - { - "label": "January", - "value": "january" - }, - { - "label": "February", - "value": "february" - }, - { - "label": "March", - "value": "march" - }, - { - "label": "April", - "value": "april" - }, - { - "label": "May", - "value": "may" - }, - { - "label": "June", - "value": "june" - }, - { - "label": "July", - "value": "july" - }, - { - "label": "August", - "value": "august" - }, - { - "label": "September", - "value": "september" - }, - { - "label": "October", - "value": "october" - }, - { - "label": "November", - "value": "november" - }, - { - "label": "December", - "value": "december" - } - ] - } - ] -} diff --git a/post-types/tour.json b/post-types/tour.json deleted file mode 100644 index a9db77f..0000000 --- a/post-types/tour.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "type": "postType", - "postType": "tour", - "slug": "tour", - "label": "Tour", - "pluralLabel": "Tours", - "icon": "palmtree", - "hierarchical": false, - "showInRest": true, - "showInMenu": "tour-operator", - "menuPosition": 10, - "template": [], - "fields": [ - { - "slug": "tagline", - "type": "string", - "label": "Tagline", - "description": "", - "visible": true - }, - { - "slug": "price", - "type": "string", - "label": "Price", - "description": "Set the price of the tour.", - "visible": true - }, - { - "slug": "sale_price", - "type": "string", - "label": "Sale Price", - "description": "Set the sale price of the tour.", - "visible": true - }, - { - "slug": "duration", - "type": "string", - "label": "Duration", - "description": "Enter the duration of the tour (in days)", - "visible": true - }, - { - "slug": "single_supplement", - "type": "string", - "label": "Single Supplement", - "description": "Set the additional cost for a single person booking the tour.", - "visible": true - }, - { - "slug": "best_time_to_visit", - "type": "multiselect", - "label": "Best time to visit", - "description": "Select the best months to take the tour.", - "visible": true, - "options": [ - { - "label": "January", - "value": "january" - }, - { - "label": "February", - "value": "february" - }, - { - "label": "March", - "value": "march" - }, - { - "label": "April", - "value": "april" - }, - { - "label": "May", - "value": "may" - }, - { - "label": "June", - "value": "june" - }, - { - "label": "July", - "value": "july" - }, - { - "label": "August", - "value": "august" - }, - { - "label": "September", - "value": "september" - }, - { - "label": "October", - "value": "october" - }, - { - "label": "November", - "value": "november" - }, - { - "label": "December", - "value": "december" - } - ] - } - ] -} diff --git a/vendors/.DS_Store b/vendors/.DS_Store index a3b8a455750e020528c138bcb7a9476741d628e8..b2d0cd8e789c73ec0a2e296708a97028f8cc3f77 100644 GIT binary patch delta 55 zcmZoMXffDe%E*{H*^JQ|NER{Lv!ycRzGO@8uY+&8Y I&heKY0K-fWP5=M^ delta 55 zcmZoMXffDe%E*{F*^JQ|NER{Lvn4X*zGO@8uY+&8Y I&heKY0KotdJ^%m! From d271c84b6b66ce2171d384864ab30b15e0ffe4fe Mon Sep 17 00:00:00 2001 From: Warwick Date: Wed, 29 Jan 2025 12:25:04 +0200 Subject: [PATCH 05/17] Fixing the inclusion of multiple post types. --- classes/class-core.php | 5 +++-- lsx-starter-plugin.php | 4 +++- vendors/.DS_Store | Bin 6148 -> 6148 bytes .../class-content-model-json-initializer.php | 20 +++++++++++++----- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/classes/class-core.php b/classes/class-core.php index 0ea7a3c..539e975 100644 --- a/classes/class-core.php +++ b/classes/class-core.php @@ -31,7 +31,7 @@ class Core { * Contructor */ public function __construct() { - $this->load_vendor(); + add_action( 'init', [ $this, 'load_vendor' ], 9 ); $this->load_classes(); } @@ -68,7 +68,8 @@ private function load_classes() { * * @return void */ - private function load_vendor() { + public function load_vendor() { + global $CONTENT_MODEL_JSON_PATH; require_once LSX_STARTER_PLUGIN_PATH . 'vendors/create-content-model/create-content-model.php'; } } diff --git a/lsx-starter-plugin.php b/lsx-starter-plugin.php index b4c5c65..32beada 100644 --- a/lsx-starter-plugin.php +++ b/lsx-starter-plugin.php @@ -20,7 +20,9 @@ define( 'LSX_STARTER_PLUGIN_CORE', __FILE__ ); define( 'LSX_STARTER_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); define( 'LSX_STARTER_PLUGIN_VER', '1.1.0' ); -define( 'CONTENT_MODEL_JSON_PATH', LSX_STARTER_PLUGIN_PATH ); + +global $CONTENT_MODEL_JSON_PATH; +$CONTENT_MODEL_JSON_PATH[] = LSX_STARTER_PLUGIN_PATH; /* ======================= Below is the Plugin Class init ========================= */ diff --git a/vendors/.DS_Store b/vendors/.DS_Store index b2d0cd8e789c73ec0a2e296708a97028f8cc3f77..7f763c67daf49e244c2807d15f90133292bf36b9 100644 GIT binary patch delta 76 zcmZoMXfc=|#>B)qu~2NHo+2ab#DLw41(+BaSts)_>TsqMC+8&P=jSkP=3zX>x|yAW ep983NGb7V?=E?jbmK=->3_!%dusJ|v3o`)V^$~&q delta 62 zcmZoMXfc=|#>B`mu~2NHo+2a5#DLw5ESnvfj json_decode( file_get_contents( $file ), true ), - $post_types - ); + global $CONTENT_MODEL_JSON_PATH; + if ( ! isset( $CONTENT_MODEL_JSON_PATH ) ) { + return; + } + + $post_types = []; + + foreach ( $CONTENT_MODEL_JSON_PATH as $json_path ) { + $types = glob( $json_path . '/post-types/*.json' ); + $types = array_map( + fn( $file ) => json_decode( file_get_contents( $file ), true ), + $types + ); + $post_types = array_merge( $post_types, $types ); + } self::register_content_models_from_json( $post_types ); self::delete_dangling_content_models( $post_types ); From eb1badb5299040e6a2c8691245778dbd97b91312 Mon Sep 17 00:00:00 2001 From: Warwick Date: Wed, 29 Jan 2025 12:54:30 +0200 Subject: [PATCH 06/17] Removing the unused scripts and totals. --- assets/css/{scss => }/lsx-starter-plugin.scss | 0 .../css/maps/lsx-starter-plugin-admin.css.map | 1 - assets/css/maps/lsx-starter-plugin.css.map | 1 - classes/class-core.php | 1 - classes/class-setup.php | 9 - composer.json | 25 - composer.lock | 2700 ----------------- gulpfile.js | 132 - 8 files changed, 2869 deletions(-) rename assets/css/{scss => }/lsx-starter-plugin.scss (100%) delete mode 100644 assets/css/maps/lsx-starter-plugin-admin.css.map delete mode 100644 assets/css/maps/lsx-starter-plugin.css.map delete mode 100644 composer.json delete mode 100644 composer.lock delete mode 100644 gulpfile.js diff --git a/assets/css/scss/lsx-starter-plugin.scss b/assets/css/lsx-starter-plugin.scss similarity index 100% rename from assets/css/scss/lsx-starter-plugin.scss rename to assets/css/lsx-starter-plugin.scss diff --git a/assets/css/maps/lsx-starter-plugin-admin.css.map b/assets/css/maps/lsx-starter-plugin-admin.css.map deleted file mode 100644 index 9cefbcc..0000000 --- a/assets/css/maps/lsx-starter-plugin-admin.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["lsx-starter-plugin-admin.scss"],"names":[],"mappings":"AAAA,qEAIG","file":"../lsx-starter-plugin-admin.css","sourcesContent":["/**\n * LSX Starter Plugin styles (admin).\n *\n * @package lsx-starter-plugin\n */\n"]} \ No newline at end of file diff --git a/assets/css/maps/lsx-starter-plugin.css.map b/assets/css/maps/lsx-starter-plugin.css.map deleted file mode 100644 index 10874ad..0000000 --- a/assets/css/maps/lsx-starter-plugin.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["lsx-starter-plugin.scss"],"names":[],"mappings":"AAAA,6DAIG","file":"../lsx-starter-plugin.css","sourcesContent":["/**\n * LSX Starter Plugin styles.\n *\n * @package lsx-starter-plugin\n */\n\n@import 'include-media';\n"]} \ No newline at end of file diff --git a/classes/class-core.php b/classes/class-core.php index 539e975..0886521 100644 --- a/classes/class-core.php +++ b/classes/class-core.php @@ -69,7 +69,6 @@ private function load_classes() { * @return void */ public function load_vendor() { - global $CONTENT_MODEL_JSON_PATH; require_once LSX_STARTER_PLUGIN_PATH . 'vendors/create-content-model/create-content-model.php'; } } diff --git a/classes/class-setup.php b/classes/class-setup.php index 0d25f11..163f21d 100644 --- a/classes/class-setup.php +++ b/classes/class-setup.php @@ -7,15 +7,6 @@ */ class Setup { - /** - * Holds class instance - * - * @since 1.0.0 - * - * @var object \lsx_starter_plugin\classes\Setup() - */ - protected static $instance = null; - /** * Contructor */ diff --git a/composer.json b/composer.json deleted file mode 100644 index aace749..0000000 --- a/composer.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "lightspeeddevelopment/lsx-starter-plugin", - "description": "Use the LSX Starter Plugin for building your own extensions for the LSX theme, expanding its already vast functionalities.", - "type": "wordpress-plugin", - "require": { - "php": ">=7.2", - "composer/installers": "^2.0.0" - }, - "require-dev": { - "phpunit/phpunit": "^8.5", - "wp-coding-standards/wpcs": "^3.0", - "dealerdirect/phpcodesniffer-composer-installer": "^1.0.0", - "wpackagist-plugin/tour-operator": "^1.4.1", - "wpackagist-theme/lsx": "^3.0", - "phpcompatibility/phpcompatibility-wp": "^2.1.0", - "roave/security-advisories": "dev-master" - }, - "repositories":[{ - "type":"composer", - "url":"https://wpackagist.org" - }], - "license": "GPL-3.0-or-later", - "prefer-stable": true, - "minimum-stability": "dev" -} diff --git a/composer.lock b/composer.lock deleted file mode 100644 index 29a35ac..0000000 --- a/composer.lock +++ /dev/null @@ -1,2700 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "816cfc8e15583c00fc45c362d531ce5a", - "packages": [ - { - "name": "composer/installers", - "version": "v2.2.0", - "source": { - "type": "git", - "url": "https://github.com/composer/installers.git", - "reference": "c29dc4b93137acb82734f672c37e029dfbd95b35" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/installers/zipball/c29dc4b93137acb82734f672c37e029dfbd95b35", - "reference": "c29dc4b93137acb82734f672c37e029dfbd95b35", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.0 || ^2.0", - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "composer/composer": "1.6.* || ^2.0", - "composer/semver": "^1 || ^3", - "phpstan/phpstan": "^0.12.55", - "phpstan/phpstan-phpunit": "^0.12.16", - "symfony/phpunit-bridge": "^5.3", - "symfony/process": "^5" - }, - "type": "composer-plugin", - "extra": { - "class": "Composer\\Installers\\Plugin", - "branch-alias": { - "dev-main": "2.x-dev" - }, - "plugin-modifies-install-path": true - }, - "autoload": { - "psr-4": { - "Composer\\Installers\\": "src/Composer/Installers" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kyle Robinson Young", - "email": "kyle@dontkry.com", - "homepage": "https://github.com/shama" - } - ], - "description": "A multi-framework Composer library installer", - "homepage": "https://composer.github.io/installers/", - "keywords": [ - "Dolibarr", - "Eliasis", - "Hurad", - "ImageCMS", - "Kanboard", - "Lan Management System", - "MODX Evo", - "MantisBT", - "Mautic", - "Maya", - "OXID", - "Plentymarkets", - "Porto", - "RadPHP", - "SMF", - "Starbug", - "Thelia", - "Whmcs", - "WolfCMS", - "agl", - "annotatecms", - "attogram", - "bitrix", - "cakephp", - "chef", - "cockpit", - "codeigniter", - "concrete5", - "croogo", - "dokuwiki", - "drupal", - "eZ Platform", - "elgg", - "expressionengine", - "fuelphp", - "grav", - "installer", - "itop", - "known", - "kohana", - "laravel", - "lavalite", - "lithium", - "magento", - "majima", - "mako", - "matomo", - "mediawiki", - "miaoxing", - "modulework", - "modx", - "moodle", - "osclass", - "pantheon", - "phpbb", - "piwik", - "ppi", - "processwire", - "puppet", - "pxcms", - "reindex", - "roundcube", - "shopware", - "silverstripe", - "sydes", - "sylius", - "tastyigniter", - "wordpress", - "yawik", - "zend", - "zikula" - ], - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2022-08-20T06:45:11+00:00" - } - ], - "packages-dev": [ - { - "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v1.0.0", - "source": { - "type": "git", - "url": "https://github.com/PHPCSStandards/composer-installer.git", - "reference": "4be43904336affa5c2f70744a348312336afd0da" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/4be43904336affa5c2f70744a348312336afd0da", - "reference": "4be43904336affa5c2f70744a348312336afd0da", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.0 || ^2.0", - "php": ">=5.4", - "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" - }, - "require-dev": { - "composer/composer": "*", - "ext-json": "*", - "ext-zip": "*", - "php-parallel-lint/php-parallel-lint": "^1.3.1", - "phpcompatibility/php-compatibility": "^9.0", - "yoast/phpunit-polyfills": "^1.0" - }, - "type": "composer-plugin", - "extra": { - "class": "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" - }, - "autoload": { - "psr-4": { - "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Franck Nijhof", - "email": "franck.nijhof@dealerdirect.com", - "homepage": "http://www.frenck.nl", - "role": "Developer / IT Manager" - }, - { - "name": "Contributors", - "homepage": "https://github.com/PHPCSStandards/composer-installer/graphs/contributors" - } - ], - "description": "PHP_CodeSniffer Standards Composer Installer Plugin", - "homepage": "http://www.dealerdirect.com", - "keywords": [ - "PHPCodeSniffer", - "PHP_CodeSniffer", - "code quality", - "codesniffer", - "composer", - "installer", - "phpcbf", - "phpcs", - "plugin", - "qa", - "quality", - "standard", - "standards", - "style guide", - "stylecheck", - "tests" - ], - "time": "2023-01-05T11:28:13+00:00" - }, - { - "name": "doctrine/instantiator", - "version": "1.5.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^9 || ^11", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.16 || ^1", - "phpstan/phpstan": "^1.4", - "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.30 || ^5.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], - "time": "2022-12-30T00:15:36+00:00" - }, - { - "name": "myclabs/deep-copy", - "version": "1.11.1", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "conflict": { - "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" - }, - "require-dev": { - "doctrine/collections": "^1.6.8", - "doctrine/common": "^2.13.3 || ^3.2.2", - "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" - }, - "type": "library", - "autoload": { - "files": [ - "src/DeepCopy/deep_copy.php" - ], - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" - } - ], - "time": "2023-03-08T13:26:56+00:00" - }, - { - "name": "phar-io/manifest", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-phar": "*", - "ext-xmlwriter": "*", - "phar-io/version": "^3.0.1", - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2021-07-20T11:28:43+00:00" - }, - { - "name": "phar-io/version", - "version": "3.2.1", - "source": { - "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Library for handling version information and constraints", - "time": "2022-02-21T01:04:05+00:00" - }, - { - "name": "phpcompatibility/php-compatibility", - "version": "9.3.5", - "source": { - "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", - "shasum": "" - }, - "require": { - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" - }, - "conflict": { - "squizlabs/php_codesniffer": "2.6.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" - }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." - }, - "type": "phpcodesniffer-standard", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-3.0-or-later" - ], - "authors": [ - { - "name": "Wim Godden", - "homepage": "https://github.com/wimg", - "role": "lead" - }, - { - "name": "Juliette Reinders Folmer", - "homepage": "https://github.com/jrfnl", - "role": "lead" - }, - { - "name": "Contributors", - "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" - } - ], - "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", - "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", - "keywords": [ - "compatibility", - "phpcs", - "standards" - ], - "time": "2019-12-27T09:44:58+00:00" - }, - { - "name": "phpcompatibility/phpcompatibility-paragonie", - "version": "1.3.1", - "source": { - "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", - "reference": "ddabec839cc003651f2ce695c938686d1086cf43" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/ddabec839cc003651f2ce695c938686d1086cf43", - "reference": "ddabec839cc003651f2ce695c938686d1086cf43", - "shasum": "" - }, - "require": { - "phpcompatibility/php-compatibility": "^9.0" - }, - "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7", - "paragonie/random_compat": "dev-master", - "paragonie/sodium_compat": "dev-master" - }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." - }, - "type": "phpcodesniffer-standard", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-3.0-or-later" - ], - "authors": [ - { - "name": "Wim Godden", - "role": "lead" - }, - { - "name": "Juliette Reinders Folmer", - "role": "lead" - } - ], - "description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.", - "homepage": "http://phpcompatibility.com/", - "keywords": [ - "compatibility", - "paragonie", - "phpcs", - "polyfill", - "standards" - ], - "time": "2021-02-15T10:24:51+00:00" - }, - { - "name": "phpcompatibility/phpcompatibility-wp", - "version": "2.1.4", - "source": { - "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", - "reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5", - "reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5", - "shasum": "" - }, - "require": { - "phpcompatibility/php-compatibility": "^9.0", - "phpcompatibility/phpcompatibility-paragonie": "^1.0" - }, - "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7" - }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." - }, - "type": "phpcodesniffer-standard", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-3.0-or-later" - ], - "authors": [ - { - "name": "Wim Godden", - "role": "lead" - }, - { - "name": "Juliette Reinders Folmer", - "role": "lead" - } - ], - "description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.", - "homepage": "http://phpcompatibility.com/", - "keywords": [ - "compatibility", - "phpcs", - "standards", - "static analysis", - "wordpress" - ], - "time": "2022-10-24T09:00:36+00:00" - }, - { - "name": "phpcsstandards/phpcsextra", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/PHPCSStandards/PHPCSExtra.git", - "reference": "98bcdbacbda14b1db85f710b1853125726795bbc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/98bcdbacbda14b1db85f710b1853125726795bbc", - "reference": "98bcdbacbda14b1db85f710b1853125726795bbc", - "shasum": "" - }, - "require": { - "php": ">=5.4", - "phpcsstandards/phpcsutils": "^1.0.8", - "squizlabs/php_codesniffer": "^3.7.1" - }, - "require-dev": { - "php-parallel-lint/php-console-highlighter": "^1.0", - "php-parallel-lint/php-parallel-lint": "^1.3.2", - "phpcsstandards/phpcsdevcs": "^1.1.6", - "phpcsstandards/phpcsdevtools": "^1.2.1", - "phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0" - }, - "type": "phpcodesniffer-standard", - "extra": { - "branch-alias": { - "dev-stable": "1.x-dev", - "dev-develop": "1.x-dev" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-3.0-or-later" - ], - "authors": [ - { - "name": "Juliette Reinders Folmer", - "homepage": "https://github.com/jrfnl", - "role": "lead" - }, - { - "name": "Contributors", - "homepage": "https://github.com/PHPCSStandards/PHPCSExtra/graphs/contributors" - } - ], - "description": "A collection of sniffs and standards for use with PHP_CodeSniffer.", - "keywords": [ - "PHP_CodeSniffer", - "phpcbf", - "phpcodesniffer-standard", - "phpcs", - "standards", - "static analysis" - ], - "time": "2023-08-26T04:46:45+00:00" - }, - { - "name": "phpcsstandards/phpcsutils", - "version": "1.0.8", - "source": { - "type": "git", - "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", - "reference": "69465cab9d12454e5e7767b9041af0cd8cd13be7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/69465cab9d12454e5e7767b9041af0cd8cd13be7", - "reference": "69465cab9d12454e5e7767b9041af0cd8cd13be7", - "shasum": "" - }, - "require": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0", - "php": ">=5.4", - "squizlabs/php_codesniffer": "^3.7.1 || 4.0.x-dev@dev" - }, - "require-dev": { - "ext-filter": "*", - "php-parallel-lint/php-console-highlighter": "^1.0", - "php-parallel-lint/php-parallel-lint": "^1.3.2", - "phpcsstandards/phpcsdevcs": "^1.1.6", - "yoast/phpunit-polyfills": "^1.0.5 || ^2.0.0" - }, - "type": "phpcodesniffer-standard", - "extra": { - "branch-alias": { - "dev-stable": "1.x-dev", - "dev-develop": "1.x-dev" - } - }, - "autoload": { - "classmap": [ - "PHPCSUtils/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-3.0-or-later" - ], - "authors": [ - { - "name": "Juliette Reinders Folmer", - "homepage": "https://github.com/jrfnl", - "role": "lead" - }, - { - "name": "Contributors", - "homepage": "https://github.com/PHPCSStandards/PHPCSUtils/graphs/contributors" - } - ], - "description": "A suite of utility functions for use with PHP_CodeSniffer", - "homepage": "https://phpcsutils.com/", - "keywords": [ - "PHP_CodeSniffer", - "phpcbf", - "phpcodesniffer-standard", - "phpcs", - "phpcs3", - "standards", - "static analysis", - "tokens", - "utility" - ], - "time": "2023-07-16T21:39:41+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "7.0.15", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "819f92bba8b001d4363065928088de22f25a3a48" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/819f92bba8b001d4363065928088de22f25a3a48", - "reference": "819f92bba8b001d4363065928088de22f25a3a48", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-xmlwriter": "*", - "php": ">=7.2", - "phpunit/php-file-iterator": "^2.0.2", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^3.1.3 || ^4.0", - "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^4.2.2", - "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1.3" - }, - "require-dev": { - "phpunit/phpunit": "^8.2.2" - }, - "suggest": { - "ext-xdebug": "^2.7.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "7.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2021-07-26T12:20:09+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "2.0.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5", - "reference": "42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2021-12-02T12:42:26+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "time": "2015-06-21T13:50:34+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "2.1.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/2454ae1765516d20c4ffe103d85a58a9a3bd5662", - "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T08:20:02+00:00" - }, - { - "name": "phpunit/php-token-stream", - "version": "3.1.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "9c1da83261628cb24b6a6df371b6e312b3954768" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/9c1da83261628cb24b6a6df371b6e312b3954768", - "reference": "9c1da83261628cb24b6a6df371b6e312b3954768", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "abandoned": true, - "time": "2021-07-26T12:15:06+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "8.5.36", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "9652df58e06a681429d8cfdaec3c43d6de581d5a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9652df58e06a681429d8cfdaec3c43d6de581d5a", - "reference": "9652df58e06a681429d8cfdaec3c43d6de581d5a", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.3.1", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.0", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", - "php": ">=7.2", - "phpunit/php-code-coverage": "^7.0.12", - "phpunit/php-file-iterator": "^2.0.4", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^2.1.2", - "sebastian/comparator": "^3.0.5", - "sebastian/diff": "^3.0.2", - "sebastian/environment": "^4.2.3", - "sebastian/exporter": "^3.1.5", - "sebastian/global-state": "^3.0.0", - "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^2.0.1", - "sebastian/type": "^1.1.3", - "sebastian/version": "^2.0.1" - }, - "suggest": { - "ext-soap": "To be able to generate mocks based on WSDL files", - "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage", - "phpunit/php-invoker": "To allow enforcing time limits" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "8.5-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "funding": [ - { - "url": "https://phpunit.de/sponsors.html", - "type": "custom" - }, - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", - "type": "tidelift" - } - ], - "time": "2023-12-01T16:52:15+00:00" - }, - { - "name": "roave/security-advisories", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "b4728d9c4af8c60b059c1d7872759eedacccdb12" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/b4728d9c4af8c60b059c1d7872759eedacccdb12", - "reference": "b4728d9c4af8c60b059c1d7872759eedacccdb12", - "shasum": "" - }, - "conflict": { - "3f/pygmentize": "<1.2", - "admidio/admidio": "<4.2.13", - "adodb/adodb-php": "<=5.20.20|>=5.21,<=5.21.3", - "aheinze/cockpit": "<2.2", - "aimeos/aimeos-typo3": "<19.10.12|>=20,<20.10.5", - "airesvsg/acf-to-rest-api": "<=3.1", - "akaunting/akaunting": "<2.1.13", - "akeneo/pim-community-dev": "<5.0.119|>=6,<6.0.53", - "alextselegidis/easyappointments": "<1.5", - "alterphp/easyadmin-extension-bundle": ">=1.2,<1.2.11|>=1.3,<1.3.1", - "amazing/media2click": ">=1,<1.3.3", - "amphp/artax": "<1.0.6|>=2,<2.0.6", - "amphp/http": "<1.0.1", - "amphp/http-client": ">=4,<4.4", - "anchorcms/anchor-cms": "<=0.12.7", - "andreapollastri/cipi": "<=3.1.15", - "andrewhaine/silverstripe-form-capture": ">=0.2,<=0.2.3|>=1,<1.0.2|>=2,<2.2.5", - "apache-solr-for-typo3/solr": "<2.8.3", - "apereo/phpcas": "<1.6", - "api-platform/core": ">=2.2,<2.2.10|>=2.3,<2.3.6|>=2.6,<2.7.10|>=3,<3.0.12|>=3.1,<3.1.3", - "appwrite/server-ce": "<=1.2.1", - "arc/web": "<3", - "area17/twill": "<1.2.5|>=2,<2.5.3", - "artesaos/seotools": "<0.17.2", - "asymmetricrypt/asymmetricrypt": "<9.9.99", - "athlon1600/php-proxy": "<=5.1", - "athlon1600/php-proxy-app": "<=3", - "austintoddj/canvas": "<=3.4.2", - "automad/automad": "<1.8", - "awesome-support/awesome-support": "<=6.0.7", - "aws/aws-sdk-php": ">=3,<3.2.1", - "azuracast/azuracast": "<0.18.3", - "backdrop/backdrop": "<1.24.2", - "backpack/crud": "<3.4.9", - "bacula-web/bacula-web": "<8.0.0.0-RC2-dev", - "badaso/core": "<2.7", - "bagisto/bagisto": "<0.1.5", - "barrelstrength/sprout-base-email": "<1.2.7", - "barrelstrength/sprout-forms": "<3.9", - "barryvdh/laravel-translation-manager": "<0.6.2", - "barzahlen/barzahlen-php": "<2.0.1", - "baserproject/basercms": "<4.8", - "bassjobsen/bootstrap-3-typeahead": ">4.0.2", - "bigfork/silverstripe-form-capture": ">=3,<3.1.1", - "billz/raspap-webgui": "<2.9.5", - "bk2k/bootstrap-package": ">=7.1,<7.1.2|>=8,<8.0.8|>=9,<9.0.4|>=9.1,<9.1.3|>=10,<10.0.10|>=11,<11.0.3", - "bmarshall511/wordpress_zero_spam": "<5.2.13", - "bolt/bolt": "<3.7.2", - "bolt/core": "<=4.2", - "bottelet/flarepoint": "<2.2.1", - "brightlocal/phpwhois": "<=4.2.5", - "brotkrueml/codehighlight": "<2.7", - "brotkrueml/schema": "<1.13.1|>=2,<2.5.1", - "brotkrueml/typo3-matomo-integration": "<1.3.2", - "buddypress/buddypress": "<7.2.1", - "bugsnag/bugsnag-laravel": "<2.0.2", - "bytefury/crater": "<6.0.2", - "cachethq/cachet": "<2.5.1", - "cakephp/cakephp": "<3.10.3|>=4,<4.0.10|>=4.1,<4.1.4|>=4.2,<4.2.12|>=4.3,<4.3.11|>=4.4,<4.4.10", - "cakephp/database": ">=4.2,<4.2.12|>=4.3,<4.3.11|>=4.4,<4.4.10", - "cardgate/magento2": "<2.0.33", - "cardgate/woocommerce": "<=3.1.15", - "cart2quote/module-quotation": ">=4.1.6,<=4.4.5|>=5,<5.4.4", - "cartalyst/sentry": "<=2.1.6", - "catfan/medoo": "<1.7.5", - "cecil/cecil": "<7.47.1", - "centreon/centreon": "<22.10.0.0-beta1", - "cesnet/simplesamlphp-module-proxystatistics": "<3.1", - "chriskacerguis/codeigniter-restserver": "<=2.7.1", - "civicrm/civicrm-core": ">=4.2,<4.2.9|>=4.3,<4.3.3", - "cockpit-hq/cockpit": "<=2.6.3", - "codeception/codeception": "<3.1.3|>=4,<4.1.22", - "codeigniter/framework": "<3.1.9", - "codeigniter4/framework": "<=4.4.2", - "codeigniter4/shield": "<1.0.0.0-beta8", - "codiad/codiad": "<=2.8.4", - "composer/composer": "<1.10.27|>=2,<2.2.22|>=2.3,<2.6.4", - "concrete5/concrete5": "<9.2.2", - "concrete5/core": "<8.5.8|>=9,<9.1", - "contao-components/mediaelement": ">=2.14.2,<2.21.1", - "contao/contao": ">=4,<4.4.56|>=4.5,<4.9.40|>=4.10,<4.11.7|>=4.13,<4.13.21|>=5.1,<5.1.4", - "contao/core": ">=2,<3.5.39", - "contao/core-bundle": "<4.9.42|>=4.10,<4.13.28|>=5,<5.1.10", - "contao/listing-bundle": ">=4,<4.4.8", - "contao/managed-edition": "<=1.5", - "cosenary/instagram": "<=2.3", - "craftcms/cms": "<=4.4.14", - "croogo/croogo": "<4", - "cuyz/valinor": "<0.12", - "czproject/git-php": "<4.0.3", - "darylldoyle/safe-svg": "<1.9.10", - "datadog/dd-trace": ">=0.30,<0.30.2", - "datatables/datatables": "<1.10.10", - "david-garcia/phpwhois": "<=4.3.1", - "dbrisinajumi/d2files": "<1", - "dcat/laravel-admin": "<=2.1.3.0-beta", - "derhansen/fe_change_pwd": "<2.0.5|>=3,<3.0.3", - "derhansen/sf_event_mgt": "<4.3.1|>=5,<5.1.1", - "desperado/xml-bundle": "<=0.1.7", - "directmailteam/direct-mail": "<5.2.4", - "doctrine/annotations": "<1.2.7", - "doctrine/cache": "<1.3.2|>=1.4,<1.4.2", - "doctrine/common": "<2.4.3|>=2.5,<2.5.1", - "doctrine/dbal": ">=2,<2.0.8|>=2.1,<2.1.2|>=3,<3.1.4", - "doctrine/doctrine-bundle": "<1.5.2", - "doctrine/doctrine-module": "<=0.7.1", - "doctrine/mongodb-odm": "<1.0.2", - "doctrine/mongodb-odm-bundle": "<3.0.1", - "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1|>=2.8.3,<2.8.4", - "dolibarr/dolibarr": "<18.0.2", - "dompdf/dompdf": "<2.0.2|==2.0.2", - "doublethreedigital/guest-entries": "<3.1.2", - "drupal/core": "<9.4.14|>=9.5,<9.5.8|>=10,<10.0.8", - "drupal/drupal": ">=6,<6.38|>=7,<7.80|>=8,<8.9.16|>=9,<9.1.12|>=9.2,<9.2.4", - "duncanmcclean/guest-entries": "<3.1.2", - "dweeves/magmi": "<=0.7.24", - "ecodev/newsletter": "<=4", - "ectouch/ectouch": "<=2.7.2", - "elefant/cms": "<2.0.7", - "elgg/elgg": "<3.3.24|>=4,<4.0.5", - "encore/laravel-admin": "<=1.8.19", - "endroid/qr-code-bundle": "<3.4.2", - "enshrined/svg-sanitize": "<0.15", - "erusev/parsedown": "<1.7.2", - "ether/logs": "<3.0.4", - "evolutioncms/evolution": "<=3.2.3", - "exceedone/exment": "<4.4.3|>=5,<5.0.3", - "exceedone/laravel-admin": "<2.2.3|==3", - "ezsystems/demobundle": ">=5.4,<5.4.6.1-dev", - "ezsystems/ez-support-tools": ">=2.2,<2.2.3", - "ezsystems/ezdemo-ls-extension": ">=5.4,<5.4.2.1-dev", - "ezsystems/ezfind-ls": ">=5.3,<5.3.6.1-dev|>=5.4,<5.4.11.1-dev|>=2017.12,<2017.12.0.1-dev", - "ezsystems/ezplatform": "<=1.13.6|>=2,<=2.5.24", - "ezsystems/ezplatform-admin-ui": ">=1.3,<1.3.5|>=1.4,<1.4.6|>=1.5,<1.5.29|>=2.3,<2.3.26", - "ezsystems/ezplatform-admin-ui-assets": ">=4,<4.2.1|>=5,<5.0.1|>=5.1,<5.1.1", - "ezsystems/ezplatform-graphql": ">=1.0.0.0-RC1-dev,<1.0.13|>=2.0.0.0-beta1,<2.3.12", - "ezsystems/ezplatform-kernel": "<1.2.5.1-dev|>=1.3,<1.3.34", - "ezsystems/ezplatform-rest": ">=1.2,<=1.2.2|>=1.3,<1.3.8", - "ezsystems/ezplatform-richtext": ">=2.3,<2.3.7.1-dev", - "ezsystems/ezplatform-solr-search-engine": ">=1.7,<1.7.12|>=2,<2.0.2|>=3.3,<3.3.15", - "ezsystems/ezplatform-user": ">=1,<1.0.1", - "ezsystems/ezpublish-kernel": "<6.13.8.2-dev|>=7,<7.5.31", - "ezsystems/ezpublish-legacy": "<=2017.12.7.3|>=2018.6,<=2019.03.5.1", - "ezsystems/platform-ui-assets-bundle": ">=4.2,<4.2.3", - "ezsystems/repository-forms": ">=2.3,<2.3.2.1-dev|>=2.5,<2.5.15", - "ezyang/htmlpurifier": "<4.1.1", - "facade/ignition": "<1.16.15|>=2,<2.4.2|>=2.5,<2.5.2", - "facturascripts/facturascripts": "<=2022.08", - "feehi/cms": "<=2.1.1", - "feehi/feehicms": "<=2.1.1", - "fenom/fenom": "<=2.12.1", - "filegator/filegator": "<7.8", - "firebase/php-jwt": "<6", - "fixpunkt/fp-masterquiz": "<2.2.1|>=3,<3.5.2", - "fixpunkt/fp-newsletter": "<1.1.1|>=2,<2.1.2|>=2.2,<3.2.6", - "flarum/core": "<1.8", - "flarum/framework": "<1.8", - "flarum/mentions": "<1.6.3", - "flarum/sticky": ">=0.1.0.0-beta14,<=0.1.0.0-beta15", - "flarum/tags": "<=0.1.0.0-beta13", - "floriangaerber/magnesium": "<0.3.1", - "fluidtypo3/vhs": "<5.1.1", - "fof/byobu": ">=0.3.0.0-beta2,<1.1.7", - "fof/upload": "<1.2.3", - "foodcoopshop/foodcoopshop": ">=3.2,<3.6.1", - "fooman/tcpdf": "<6.2.22", - "forkcms/forkcms": "<5.11.1", - "fossar/tcpdf-parser": "<6.2.22", - "francoisjacquet/rosariosis": "<11", - "frappant/frp-form-answers": "<3.1.2|>=4,<4.0.2", - "friendsofsymfony/oauth2-php": "<1.3", - "friendsofsymfony/rest-bundle": ">=1.2,<1.2.2", - "friendsofsymfony/user-bundle": ">=1.2,<1.3.5", - "friendsoftypo3/mediace": ">=7.6.2,<7.6.5", - "friendsoftypo3/openid": ">=4.5,<4.5.31|>=4.7,<4.7.16|>=6,<6.0.11|>=6.1,<6.1.6", - "froala/wysiwyg-editor": "<3.2.7|>=4.0.1,<=4.1.1", - "froxlor/froxlor": "<2.1.0.0-beta1", - "fuel/core": "<1.8.1", - "funadmin/funadmin": "<=3.2|>=3.3.2,<=3.3.3", - "gaoming13/wechat-php-sdk": "<=1.10.2", - "genix/cms": "<=1.1.11", - "getgrav/grav": "<=1.7.42.1", - "getkirby/cms": "<3.5.8.3-dev|>=3.6,<3.6.6.3-dev|>=3.7,<3.7.5.2-dev|>=3.8,<3.8.4.1-dev|>=3.9,<3.9.6", - "getkirby/kirby": "<=2.5.12", - "getkirby/panel": "<2.5.14", - "getkirby/starterkit": "<=3.7.0.2", - "gilacms/gila": "<=1.11.4", - "gleez/cms": "<=1.2|==2", - "globalpayments/php-sdk": "<2", - "gogentooss/samlbase": "<1.2.7", - "google/protobuf": "<3.15", - "gos/web-socket-bundle": "<1.10.4|>=2,<2.6.1|>=3,<3.3", - "gree/jose": "<2.2.1", - "gregwar/rst": "<1.0.3", - "grumpydictator/firefly-iii": "<6", - "gugoan/economizzer": "<=0.9.0.0-beta1", - "guzzlehttp/guzzle": "<6.5.8|>=7,<7.4.5", - "guzzlehttp/psr7": "<1.9.1|>=2,<2.4.5", - "haffner/jh_captcha": "<=2.1.3|>=3,<=3.0.2", - "harvesthq/chosen": "<1.8.7", - "helloxz/imgurl": "<=2.31", - "hhxsv5/laravel-s": "<3.7.36", - "hillelcoren/invoice-ninja": "<5.3.35", - "himiklab/yii2-jqgrid-widget": "<1.0.8", - "hjue/justwriting": "<=1", - "hov/jobfair": "<1.0.13|>=2,<2.0.2", - "httpsoft/http-message": "<1.0.12", - "hyn/multi-tenant": ">=5.6,<5.7.2", - "ibexa/admin-ui": ">=4.2,<4.2.3", - "ibexa/core": ">=4,<4.0.7|>=4.1,<4.1.4|>=4.2,<4.2.3|>=4.5,<4.5.4", - "ibexa/graphql": ">=2.5,<2.5.31|>=3.3,<3.3.28|>=4.2,<4.2.3", - "ibexa/post-install": "<=1.0.4", - "ibexa/solr": ">=4.5,<4.5.4", - "ibexa/user": ">=4,<4.4.3", - "icecoder/icecoder": "<=8.1", - "idno/known": "<=1.3.1", - "illuminate/auth": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.10", - "illuminate/cookie": ">=4,<=4.0.11|>=4.1,<=4.1.99999|>=4.2,<=4.2.99999|>=5,<=5.0.99999|>=5.1,<=5.1.99999|>=5.2,<=5.2.99999|>=5.3,<=5.3.99999|>=5.4,<=5.4.99999|>=5.5,<=5.5.49|>=5.6,<=5.6.99999|>=5.7,<=5.7.99999|>=5.8,<=5.8.99999|>=6,<6.18.31|>=7,<7.22.4", - "illuminate/database": "<6.20.26|>=7,<7.30.5|>=8,<8.40", - "illuminate/encryption": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15", - "illuminate/view": "<6.20.42|>=7,<7.30.6|>=8,<8.75", - "impresscms/impresscms": "<=1.4.5", - "in2code/femanager": "<5.5.3|>=6,<6.3.4|>=7,<7.2.2", - "in2code/ipandlanguageredirect": "<5.1.2", - "in2code/lux": "<17.6.1|>=18,<24.0.2", - "innologi/typo3-appointments": "<2.0.6", - "intelliants/subrion": "<4.2.2", - "islandora/islandora": ">=2,<2.4.1", - "ivankristianto/phpwhois": "<=4.3", - "jackalope/jackalope-doctrine-dbal": "<1.7.4", - "james-heinrich/getid3": "<1.9.21", - "james-heinrich/phpthumb": "<1.7.12", - "jasig/phpcas": "<1.3.3", - "jcbrand/converse.js": "<3.3.3", - "joomla/application": "<1.0.13", - "joomla/archive": "<1.1.12|>=2,<2.0.1", - "joomla/filesystem": "<1.6.2|>=2,<2.0.1", - "joomla/filter": "<1.4.4|>=2,<2.0.1", - "joomla/framework": ">=2.5.4,<=3.8.12", - "joomla/input": ">=2,<2.0.2", - "joomla/joomla-cms": ">=2.5,<3.9.12", - "joomla/session": "<1.3.1", - "joyqi/hyper-down": "<=2.4.27", - "jsdecena/laracom": "<2.0.9", - "jsmitty12/phpwhois": "<5.1", - "kazist/phpwhois": "<=4.2.6", - "kelvinmo/simplexrd": "<3.1.1", - "kevinpapst/kimai2": "<1.16.7", - "khodakhah/nodcms": "<=3", - "kimai/kimai": "<=2.1", - "kitodo/presentation": "<3.2.3|>=3.3,<3.3.4", - "klaviyo/magento2-extension": ">=1,<3", - "knplabs/knp-snappy": "<=1.4.2", - "kohana/core": "<3.3.3", - "krayin/laravel-crm": "<1.2.2", - "kreait/firebase-php": ">=3.2,<3.8.1", - "la-haute-societe/tcpdf": "<6.2.22", - "laminas/laminas-diactoros": "<2.18.1|==2.19|==2.20|==2.21|==2.22|==2.23|>=2.24,<2.24.2|>=2.25,<2.25.2", - "laminas/laminas-form": "<2.17.1|>=3,<3.0.2|>=3.1,<3.1.1", - "laminas/laminas-http": "<2.14.2", - "laravel/fortify": "<1.11.1", - "laravel/framework": "<6.20.44|>=7,<7.30.6|>=8,<8.75", - "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", - "latte/latte": "<2.10.8", - "lavalite/cms": "<=9", - "lcobucci/jwt": ">=3.4,<3.4.6|>=4,<4.0.4|>=4.1,<4.1.5", - "league/commonmark": "<0.18.3", - "league/flysystem": "<1.1.4|>=2,<2.1.1", - "league/oauth2-server": ">=8.3.2,<8.4.2|>=8.5,<8.5.3", - "lexik/jwt-authentication-bundle": "<2.10.7|>=2.11,<2.11.3", - "librenms/librenms": "<2017.08.18", - "liftkit/database": "<2.13.2", - "limesurvey/limesurvey": "<3.27.19", - "livehelperchat/livehelperchat": "<=3.91", - "livewire/livewire": ">2.2.4,<2.2.6", - "lms/routes": "<2.1.1", - "localizationteam/l10nmgr": "<7.4|>=8,<8.7|>=9,<9.2", - "luyadev/yii-helpers": "<1.2.1", - "magento/community-edition": "<=2.4", - "magento/magento1ce": "<1.9.4.3-dev", - "magento/magento1ee": ">=1,<1.14.4.3-dev", - "magento/product-community-edition": ">=2,<2.2.10|>=2.3,<2.3.2.0-patch2", - "maikuolan/phpmussel": ">=1,<1.6", - "mantisbt/mantisbt": "<=2.25.7", - "marcwillmann/turn": "<0.3.3", - "matyhtf/framework": "<3.0.6", - "mautic/core": "<4.3", - "mediawiki/core": ">=1.27,<1.27.6|>=1.29,<1.29.3|>=1.30,<1.30.2|>=1.31,<1.31.9|>=1.32,<1.32.6|>=1.32.99,<1.33.3|>=1.33.99,<1.34.3|>=1.34.99,<1.35", - "mediawiki/matomo": "<2.4.3", - "melisplatform/melis-asset-manager": "<5.0.1", - "melisplatform/melis-cms": "<5.0.1", - "melisplatform/melis-front": "<5.0.1", - "mezzio/mezzio-swoole": "<3.7|>=4,<4.3", - "mgallegos/laravel-jqgrid": "<=1.3", - "microweber/microweber": "<=2.0.4", - "miniorange/miniorange-saml": "<1.4.3", - "mittwald/typo3_forum": "<1.2.1", - "mobiledetect/mobiledetectlib": "<2.8.32", - "modx/revolution": "<=2.8.3.0-patch", - "mojo42/jirafeau": "<4.4", - "mongodb/mongodb": ">=1,<1.9.2", - "monolog/monolog": ">=1.8,<1.12", - "moodle/moodle": "<4.3.0.0-RC2-dev", - "mos/cimage": "<0.7.19", - "movim/moxl": ">=0.8,<=0.10", - "mpdf/mpdf": "<=7.1.7", - "munkireport/comment": "<4.1", - "munkireport/managedinstalls": "<2.6", - "munkireport/munkireport": ">=2.5.3,<5.6.3", - "mustache/mustache": ">=2,<2.14.1", - "namshi/jose": "<2.2", - "neoan3-apps/template": "<1.1.1", - "neorazorx/facturascripts": "<2022.04", - "neos/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.12|>=3.1,<3.1.10|>=3.2,<3.2.13|>=3.3,<3.3.13|>=4,<4.0.6", - "neos/form": ">=1.2,<4.3.3|>=5,<5.0.9|>=5.1,<5.1.3", - "neos/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4|>=2.3,<2.9.99|>=3,<3.0.20|>=3.1,<3.1.18|>=3.2,<3.2.14|>=3.3,<5.3.10|>=7,<7.0.9|>=7.1,<7.1.7|>=7.2,<7.2.6|>=7.3,<7.3.4|>=8,<8.0.2", - "neos/neos-ui": "<=8.3.3", - "neos/swiftmailer": ">=4.1,<4.1.99|>=5.4,<5.4.5", - "netgen/tagsbundle": ">=3.4,<3.4.11|>=4,<4.0.15", - "nette/application": ">=2,<2.0.19|>=2.1,<2.1.13|>=2.2,<2.2.10|>=2.3,<2.3.14|>=2.4,<2.4.16|>=3,<3.0.6", - "nette/nette": ">=2,<2.0.19|>=2.1,<2.1.13", - "nilsteampassnet/teampass": "<3.0.10", - "nonfiction/nterchange": "<4.1.1", - "notrinos/notrinos-erp": "<=0.7", - "noumo/easyii": "<=0.9", - "nukeviet/nukeviet": "<4.5.02", - "nyholm/psr7": "<1.6.1", - "nystudio107/craft-seomatic": "<3.4.12", - "nzo/url-encryptor-bundle": ">=4,<4.3.2|>=5,<5.0.1", - "october/backend": "<1.1.2", - "october/cms": "<1.0.469|==1.0.469|==1.0.471|==1.1.1", - "october/october": "<=3.4.4", - "october/rain": "<1.0.472|>=1.1,<1.1.2", - "october/system": "<1.0.476|>=1.1,<1.1.12|>=2,<2.2.34|>=3,<3.5.2", - "omeka/omeka-s": "<4.0.3", - "onelogin/php-saml": "<2.10.4", - "oneup/uploader-bundle": "<1.9.3|>=2,<2.1.5", - "open-web-analytics/open-web-analytics": "<1.7.4", - "opencart/opencart": "<=3.0.3.7|>=4,<4.0.2.3-dev", - "openid/php-openid": "<2.3", - "openmage/magento-lts": "<=19.5|>=20,<=20.1", - "opensource-workshop/connect-cms": "<1.7.2|>=2,<2.3.2", - "orchid/platform": ">=9,<9.4.4|>=14.0.0.0-alpha4,<14.5", - "oro/calendar-bundle": ">=4.2,<=4.2.6|>=5,<=5.0.6|>=5.1,<5.1.1", - "oro/commerce": ">=4.1,<5.0.11|>=5.1,<5.1.1", - "oro/crm": ">=1.7,<1.7.4|>=3.1,<4.1.17|>=4.2,<4.2.7", - "oro/crm-call-bundle": ">=4.2,<=4.2.5|>=5,<5.0.4|>=5.1,<5.1.1", - "oro/customer-portal": ">=4.2,<=4.2.8|>=5,<5.0.11|>=5.1,<5.1.1", - "oro/platform": ">=1.7,<1.7.4|>=3.1,<3.1.29|>=4.1,<4.1.17|>=4.2,<=4.2.10|>=5,<5.0.8", - "oxid-esales/oxideshop-ce": "<4.5", - "packbackbooks/lti-1-3-php-library": "<5", - "padraic/humbug_get_contents": "<1.1.2", - "pagarme/pagarme-php": "<3", - "pagekit/pagekit": "<=1.0.18", - "paragonie/random_compat": "<2", - "passbolt/passbolt_api": "<2.11", - "paypal/merchant-sdk-php": "<3.12", - "pear/archive_tar": "<1.4.14", - "pear/crypt_gpg": "<1.6.7", - "pear/pear": "<=1.10.1", - "pegasus/google-for-jobs": "<1.5.1|>=2,<2.1.1", - "personnummer/personnummer": "<3.0.2", - "phanan/koel": "<5.1.4", - "php-mod/curl": "<2.3.2", - "phpbb/phpbb": "<3.2.10|>=3.3,<3.3.1", - "phpfastcache/phpfastcache": "<6.1.5|>=7,<7.1.2|>=8,<8.0.7", - "phpmailer/phpmailer": "<6.5", - "phpmussel/phpmussel": ">=1,<1.6", - "phpmyadmin/phpmyadmin": "<5.2.1", - "phpmyfaq/phpmyfaq": "<=3.1.7", - "phpoffice/phpexcel": "<1.8", - "phpoffice/phpspreadsheet": "<1.16", - "phpseclib/phpseclib": "<3.0.34", - "phpservermon/phpservermon": "<3.6", - "phpsysinfo/phpsysinfo": "<3.2.5", - "phpunit/phpunit": ">=4.8.19,<4.8.28|>=5,<5.6.3", - "phpwhois/phpwhois": "<=4.2.5", - "phpxmlrpc/extras": "<0.6.1", - "phpxmlrpc/phpxmlrpc": "<4.9.2", - "pi/pi": "<=2.5", - "pimcore/admin-ui-classic-bundle": "<1.2.2", - "pimcore/customer-management-framework-bundle": "<3.4.2", - "pimcore/data-hub": "<1.2.4", - "pimcore/demo": "<10.3", - "pimcore/perspective-editor": "<1.5.1", - "pimcore/pimcore": "<11.1.1", - "pixelfed/pixelfed": "<=0.11.4", - "pocketmine/bedrock-protocol": "<8.0.2", - "pocketmine/pocketmine-mp": "<=4.23|>=5,<5.3.1", - "pocketmine/raklib": ">=0.14,<0.14.6|>=0.15,<0.15.1", - "pressbooks/pressbooks": "<5.18", - "prestashop/autoupgrade": ">=4,<4.10.1", - "prestashop/blockreassurance": "<=5.1.3", - "prestashop/blockwishlist": ">=2,<2.1.1", - "prestashop/contactform": ">=1.0.1,<4.3", - "prestashop/gamification": "<2.3.2", - "prestashop/prestashop": "<8.1.2", - "prestashop/productcomments": "<5.0.2", - "prestashop/ps_emailsubscription": "<2.6.1", - "prestashop/ps_facetedsearch": "<3.4.1", - "prestashop/ps_linklist": "<3.1", - "privatebin/privatebin": "<1.4", - "processwire/processwire": "<=3.0.200", - "propel/propel": ">=2.0.0.0-alpha1,<=2.0.0.0-alpha7", - "propel/propel1": ">=1,<=1.7.1", - "pterodactyl/panel": "<1.7", - "ptheofan/yii2-statemachine": ">=2.0.0.0-RC1-dev,<=2", - "ptrofimov/beanstalk_console": "<1.7.14", - "pusher/pusher-php-server": "<2.2.1", - "pwweb/laravel-core": "<=0.3.6.0-beta", - "pyrocms/pyrocms": "<=3.9.1", - "rainlab/blog-plugin": "<1.4.1", - "rainlab/debugbar-plugin": "<3.1", - "rainlab/user-plugin": "<=1.4.5", - "rankmath/seo-by-rank-math": "<=1.0.95", - "rap2hpoutre/laravel-log-viewer": "<0.13", - "react/http": ">=0.7,<1.9", - "really-simple-plugins/complianz-gdpr": "<6.4.2", - "remdex/livehelperchat": "<3.99", - "reportico-web/reportico": "<=7.1.21", - "rhukster/dom-sanitizer": "<1.0.7", - "rmccue/requests": ">=1.6,<1.8", - "robrichards/xmlseclibs": "<3.0.4", - "roots/soil": "<4.1", - "rudloff/alltube": "<3.0.3", - "s-cart/core": "<6.9", - "s-cart/s-cart": "<6.9", - "sabberworm/php-css-parser": ">=1,<1.0.1|>=2,<2.0.1|>=3,<3.0.1|>=4,<4.0.1|>=5,<5.0.9|>=5.1,<5.1.3|>=5.2,<5.2.1|>=6,<6.0.2|>=7,<7.0.4|>=8,<8.0.1|>=8.1,<8.1.1|>=8.2,<8.2.1|>=8.3,<8.3.1", - "sabre/dav": "<1.7.11|>=1.8,<1.8.9", - "scheb/two-factor-bundle": "<3.26|>=4,<4.11", - "sensiolabs/connect": "<4.2.3", - "serluck/phpwhois": "<=4.2.6", - "sfroemken/url_redirect": "<=1.2.1", - "sheng/yiicms": "<=1.2", - "shopware/core": "<=6.4.20", - "shopware/platform": "<=6.4.20", - "shopware/production": "<=6.3.5.2", - "shopware/shopware": "<=5.7.17", - "shopware/storefront": "<=6.4.8.1", - "shopxo/shopxo": "<2.2.6", - "showdoc/showdoc": "<2.10.4", - "silverstripe-australia/advancedreports": ">=1,<=2", - "silverstripe/admin": "<1.13.6", - "silverstripe/assets": ">=1,<1.11.1", - "silverstripe/cms": "<4.11.3", - "silverstripe/comments": ">=1.3,<1.9.99|>=2,<2.9.99|>=3,<3.1.1", - "silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3", - "silverstripe/framework": "<4.13.14|>=5,<5.0.13", - "silverstripe/graphql": "<3.8.2|>=4,<4.1.3|>=4.2,<4.2.5|>=4.3,<4.3.4|>=5,<5.0.3", - "silverstripe/hybridsessions": ">=1,<2.4.1|>=2.5,<2.5.1", - "silverstripe/recipe-cms": ">=4.5,<4.5.3", - "silverstripe/registry": ">=2.1,<2.1.2|>=2.2,<2.2.1", - "silverstripe/restfulserver": ">=1,<1.0.9|>=2,<2.0.4", - "silverstripe/silverstripe-omnipay": "<2.5.2|>=3,<3.0.2|>=3.1,<3.1.4|>=3.2,<3.2.1", - "silverstripe/subsites": ">=2,<2.6.1", - "silverstripe/taxonomy": ">=1.3,<1.3.1|>=2,<2.0.1", - "silverstripe/userforms": "<3", - "silverstripe/versioned-admin": ">=1,<1.11.1", - "simple-updates/phpwhois": "<=1", - "simplesamlphp/saml2": "<1.15.4|>=2,<2.3.8|>=3,<3.1.4|==5.0.0.0-alpha12", - "simplesamlphp/simplesamlphp": "<1.18.6", - "simplesamlphp/simplesamlphp-module-infocard": "<1.0.1", - "simplesamlphp/simplesamlphp-module-openid": "<1", - "simplesamlphp/simplesamlphp-module-openidprovider": "<0.9", - "simplesamlphp/xml-security": "==1.6.11", - "simplito/elliptic-php": "<1.0.6", - "sitegeist/fluid-components": "<3.5", - "sjbr/sr-freecap": "<2.4.6|>=2.5,<2.5.3", - "slim/psr7": "<1.4.1|>=1.5,<1.5.1|>=1.6,<1.6.1", - "slim/slim": "<2.6", - "slub/slub-events": "<3.0.3", - "smarty/smarty": "<3.1.48|>=4,<4.3.1", - "snipe/snipe-it": "<=6.2.2", - "socalnick/scn-social-auth": "<1.15.2", - "socialiteproviders/steam": "<1.1", - "spatie/browsershot": "<3.57.4", - "spipu/html2pdf": "<5.2.8", - "spoon/library": "<1.4.1", - "spoonity/tcpdf": "<6.2.22", - "squizlabs/php_codesniffer": ">=1,<2.8.1|>=3,<3.0.1", - "ssddanbrown/bookstack": "<22.02.3", - "statamic/cms": "<4.36", - "stormpath/sdk": "<9.9.99", - "studio-42/elfinder": "<2.1.62", - "subhh/libconnect": "<7.0.8|>=8,<8.1", - "sukohi/surpass": "<1", - "sulu/sulu": "<1.6.44|>=2,<2.2.18|>=2.3,<2.3.8|==2.4.0.0-RC1|>=2.5,<2.5.10", - "sumocoders/framework-user-bundle": "<1.4", - "swag/paypal": "<5.4.4", - "swiftmailer/swiftmailer": ">=4,<5.4.5", - "swiftyedit/swiftyedit": "<1.2", - "sylius/admin-bundle": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2", - "sylius/grid": ">=1,<1.1.19|>=1.2,<1.2.18|>=1.3,<1.3.13|>=1.4,<1.4.5|>=1.5,<1.5.1", - "sylius/grid-bundle": "<1.10.1", - "sylius/paypal-plugin": ">=1,<1.2.4|>=1.3,<1.3.1", - "sylius/resource-bundle": "<1.3.14|>=1.4,<1.4.7|>=1.5,<1.5.2|>=1.6,<1.6.4", - "sylius/sylius": "<1.9.10|>=1.10,<1.10.11|>=1.11,<1.11.2", - "symbiote/silverstripe-multivaluefield": ">=3,<3.0.99", - "symbiote/silverstripe-queuedjobs": ">=3,<3.0.2|>=3.1,<3.1.4|>=4,<4.0.7|>=4.1,<4.1.2|>=4.2,<4.2.4|>=4.3,<4.3.3|>=4.4,<4.4.3|>=4.5,<4.5.1|>=4.6,<4.6.4", - "symbiote/silverstripe-seed": "<6.0.3", - "symbiote/silverstripe-versionedfiles": "<=2.0.3", - "symfont/process": ">=0", - "symfony/cache": ">=3.1,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8", - "symfony/dependency-injection": ">=2,<2.0.17|>=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", - "symfony/error-handler": ">=4.4,<4.4.4|>=5,<5.0.4", - "symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.20|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1", - "symfony/framework-bundle": ">=2,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2|>=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7|>=5.3.14,<=5.3.14|>=5.4.3,<=5.4.3|>=6.0.3,<=6.0.3", - "symfony/http-foundation": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7", - "symfony/http-kernel": ">=2,<4.4.50|>=5,<5.4.20|>=6,<6.0.20|>=6.1,<6.1.12|>=6.2,<6.2.6", - "symfony/intl": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", - "symfony/maker-bundle": ">=1.27,<1.29.2|>=1.30,<1.31.1", - "symfony/mime": ">=4.3,<4.3.8", - "symfony/phpunit-bridge": ">=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", - "symfony/polyfill": ">=1,<1.10", - "symfony/polyfill-php55": ">=1,<1.10", - "symfony/proxy-manager-bridge": ">=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", - "symfony/routing": ">=2,<2.0.19", - "symfony/security": ">=2,<2.7.51|>=2.8,<3.4.49|>=4,<4.4.24|>=5,<5.2.8", - "symfony/security-bundle": ">=2,<4.4.50|>=5,<5.4.20|>=6,<6.0.20|>=6.1,<6.1.12|>=6.2,<6.2.6", - "symfony/security-core": ">=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8,<3.4.49|>=4,<4.4.24|>=5,<5.2.9", - "symfony/security-csrf": ">=2.4,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", - "symfony/security-guard": ">=2.8,<3.4.48|>=4,<4.4.23|>=5,<5.2.8", - "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7|>=5.1,<5.2.8|>=5.3,<5.3.2|>=5.4,<5.4.31|>=6,<6.3.8", - "symfony/serializer": ">=2,<2.0.11|>=4.1,<4.4.35|>=5,<5.3.12", - "symfony/symfony": "<4.4.51|>=5,<5.4.31|>=6,<6.3.8", - "symfony/translation": ">=2,<2.0.17", - "symfony/twig-bridge": ">=2,<4.4.51|>=5,<5.4.31|>=6,<6.3.8", - "symfony/ux-autocomplete": "<2.11.2", - "symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3", - "symfony/var-exporter": ">=4.2,<4.2.12|>=4.3,<4.3.8", - "symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4", - "symfony/webhook": ">=6.3,<6.3.8", - "symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7", - "t3/dce": "<0.11.5|>=2.2,<2.6.2", - "t3g/svg-sanitizer": "<1.0.3", - "tastyigniter/tastyigniter": "<3.3", - "tcg/voyager": "<=1.4", - "tecnickcom/tcpdf": "<6.2.22", - "terminal42/contao-tablelookupwizard": "<3.3.5", - "thelia/backoffice-default-template": ">=2.1,<2.1.2", - "thelia/thelia": ">=2.1,<2.1.3", - "theonedemon/phpwhois": "<=4.2.5", - "thinkcmf/thinkcmf": "<=5.1.7", - "thorsten/phpmyfaq": "<3.2.2", - "tikiwiki/tiki-manager": "<=17.1", - "tinymce/tinymce": "<5.10.9|>=6,<6.7.3", - "tinymighty/wiki-seo": "<1.2.2", - "titon/framework": "<9.9.99", - "tobiasbg/tablepress": "<=2.0.0.0-RC1", - "topthink/framework": "<6.0.14", - "topthink/think": "<=6.1.1", - "topthink/thinkphp": "<=3.2.3", - "tpwd/ke_search": "<4.0.3|>=4.1,<4.6.6|>=5,<5.0.2", - "tribalsystems/zenario": "<=9.4.59197", - "truckersmp/phpwhois": "<=4.3.1", - "ttskch/pagination-service-provider": "<1", - "twig/twig": "<1.44.7|>=2,<2.15.3|>=3,<3.4.3", - "typo3/cms": "<9.5.29|>=10,<10.4.35|>=11,<11.5.23|>=12,<12.2", - "typo3/cms-backend": ">=7,<=7.6.50|>=8,<=8.7.39|>=9,<=9.5.24|>=10,<=10.4.13|>=11,<=11.1", - "typo3/cms-core": "<=8.7.54|>=9,<=9.5.43|>=10,<=10.4.40|>=11,<=11.5.32|>=12,<=12.4.7", - "typo3/cms-extbase": "<6.2.24|>=7,<7.6.8|==8.1.1", - "typo3/cms-form": ">=8,<=8.7.39|>=9,<=9.5.24|>=10,<=10.4.13|>=11,<=11.1", - "typo3/cms-install": ">=12.2,<12.4.8", - "typo3/cms-rte-ckeditor": ">=9.5,<9.5.42|>=10,<10.4.39|>=11,<11.5.30", - "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.12|>=3.1,<3.1.10|>=3.2,<3.2.13|>=3.3,<3.3.13|>=4,<4.0.6", - "typo3/html-sanitizer": ">=1,<=1.5.2|>=2,<=2.1.3", - "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4|>=2.3,<2.3.99|>=3,<3.0.20|>=3.1,<3.1.18|>=3.2,<3.2.14|>=3.3,<3.3.23|>=4,<4.0.17|>=4.1,<4.1.16|>=4.2,<4.2.12|>=4.3,<4.3.3", - "typo3/phar-stream-wrapper": ">=1,<2.1.1|>=3,<3.1.1", - "typo3/swiftmailer": ">=4.1,<4.1.99|>=5.4,<5.4.5", - "typo3fluid/fluid": ">=2,<2.0.8|>=2.1,<2.1.7|>=2.2,<2.2.4|>=2.3,<2.3.7|>=2.4,<2.4.4|>=2.5,<2.5.11|>=2.6,<2.6.10", - "ua-parser/uap-php": "<3.8", - "uasoft-indonesia/badaso": "<=2.9.7", - "unisharp/laravel-filemanager": "<=2.5.1", - "userfrosting/userfrosting": ">=0.3.1,<4.6.3", - "usmanhalalit/pixie": "<1.0.3|>=2,<2.0.2", - "uvdesk/community-skeleton": "<=1.1.1", - "vanilla/safecurl": "<0.9.2", - "verot/class.upload.php": "<=1.0.3|>=2,<=2.0.4", - "vova07/yii2-fileapi-widget": "<0.1.9", - "vrana/adminer": "<4.8.1", - "waldhacker/hcaptcha": "<2.1.2", - "wallabag/tcpdf": "<6.2.22", - "wallabag/wallabag": "<2.6.7", - "wanglelecc/laracms": "<=1.0.3", - "web-auth/webauthn-framework": ">=3.3,<3.3.4", - "webbuilders-group/silverstripe-kapost-bridge": "<0.4", - "webcoast/deferred-image-processing": "<1.0.2", - "webklex/laravel-imap": "<5.3", - "webklex/php-imap": "<5.3", - "webpa/webpa": "<3.1.2", - "wikibase/wikibase": "<=1.39.3", - "wikimedia/parsoid": "<0.12.2", - "willdurand/js-translation-bundle": "<2.1.1", - "wintercms/winter": "<1.2.3", - "woocommerce/woocommerce": "<6.6", - "wp-cli/wp-cli": "<2.5", - "wp-graphql/wp-graphql": "<=1.14.5", - "wpanel/wpanel4-cms": "<=4.3.1", - "wpcloud/wp-stateless": "<3.2", - "wwbn/avideo": "<=12.4", - "xataface/xataface": "<3", - "xpressengine/xpressengine": "<3.0.15", - "yeswiki/yeswiki": "<4.1", - "yetiforce/yetiforce-crm": "<=6.4", - "yidashi/yii2cmf": "<=2", - "yii2mod/yii2-cms": "<1.9.2", - "yiisoft/yii": "<1.1.29", - "yiisoft/yii2": "<2.0.38", - "yiisoft/yii2-bootstrap": "<2.0.4", - "yiisoft/yii2-dev": "<2.0.43", - "yiisoft/yii2-elasticsearch": "<2.0.5", - "yiisoft/yii2-gii": "<=2.2.4", - "yiisoft/yii2-jui": "<2.0.4", - "yiisoft/yii2-redis": "<2.0.8", - "yikesinc/yikes-inc-easy-mailchimp-extender": "<6.8.6", - "yoast-seo-for-typo3/yoast_seo": "<7.2.3", - "yourls/yourls": "<=1.8.2", - "zencart/zencart": "<=1.5.7.0-beta", - "zendesk/zendesk_api_client_php": "<2.2.11", - "zendframework/zend-cache": "<2.4.8|>=2.5,<2.5.3", - "zendframework/zend-captcha": ">=2,<2.4.9|>=2.5,<2.5.2", - "zendframework/zend-crypt": ">=2,<2.4.9|>=2.5,<2.5.2", - "zendframework/zend-db": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.10|>=2.3,<2.3.5", - "zendframework/zend-developer-tools": ">=1.2.2,<1.2.3", - "zendframework/zend-diactoros": "<1.8.4", - "zendframework/zend-feed": "<2.10.3", - "zendframework/zend-form": ">=2,<2.2.7|>=2.3,<2.3.1", - "zendframework/zend-http": "<2.8.1", - "zendframework/zend-json": ">=2.1,<2.1.6|>=2.2,<2.2.6", - "zendframework/zend-ldap": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.8|>=2.3,<2.3.3", - "zendframework/zend-mail": ">=2,<2.4.11|>=2.5,<2.7.2", - "zendframework/zend-navigation": ">=2,<2.2.7|>=2.3,<2.3.1", - "zendframework/zend-session": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.9|>=2.3,<2.3.4", - "zendframework/zend-validator": ">=2.3,<2.3.6", - "zendframework/zend-view": ">=2,<2.2.7|>=2.3,<2.3.1", - "zendframework/zend-xmlrpc": ">=2.1,<2.1.6|>=2.2,<2.2.6", - "zendframework/zendframework": "<=3", - "zendframework/zendframework1": "<1.12.20", - "zendframework/zendopenid": "<2.0.2", - "zendframework/zendrest": "<2.0.2", - "zendframework/zendservice-amazon": "<2.0.3", - "zendframework/zendservice-api": "<1", - "zendframework/zendservice-audioscrobbler": "<2.0.2", - "zendframework/zendservice-nirvanix": "<2.0.2", - "zendframework/zendservice-slideshare": "<2.0.2", - "zendframework/zendservice-technorati": "<2.0.2", - "zendframework/zendservice-windowsazure": "<2.0.2", - "zendframework/zendxml": "<1.0.1", - "zenstruck/collection": "<0.2.1", - "zetacomponents/mail": "<1.8.2", - "zf-commons/zfc-user": "<1.2.2", - "zfcampus/zf-apigility-doctrine": "<1.0.3", - "zfr/zfr-oauth2-server-module": "<0.1.2", - "zoujingli/thinkadmin": "<6.0.22" - }, - "type": "metapackage", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "role": "maintainer" - }, - { - "name": "Ilya Tribusean", - "email": "slash3b@gmail.com", - "role": "maintainer" - } - ], - "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "keywords": [ - "dev" - ], - "funding": [ - { - "url": "https://github.com/Ocramius", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/roave/security-advisories", - "type": "tidelift" - } - ], - "time": "2023-11-30T20:04:21+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/1de8cd5c010cb153fcd68b8d0f64606f523f7619", - "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T08:15:22+00:00" - }, - { - "name": "sebastian/comparator", - "version": "3.0.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "1dc7ceb4a24aede938c7af2a9ed1de09609ca770" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1dc7ceb4a24aede938c7af2a9ed1de09609ca770", - "reference": "1dc7ceb4a24aede938c7af2a9ed1de09609ca770", - "shasum": "" - }, - "require": { - "php": ">=7.1", - "sebastian/diff": "^3.0", - "sebastian/exporter": "^3.1" - }, - "require-dev": { - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-09-14T12:31:48+00:00" - }, - { - "name": "sebastian/diff", - "version": "3.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "6296a0c086dd0117c1b78b059374d7fcbe7545ae" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/6296a0c086dd0117c1b78b059374d7fcbe7545ae", - "reference": "6296a0c086dd0117c1b78b059374d7fcbe7545ae", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.5 || ^8.0", - "symfony/process": "^2 || ^3.3 || ^4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" - ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-05-07T05:30:20+00:00" - }, - { - "name": "sebastian/environment", - "version": "4.2.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", - "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.5" - }, - "suggest": { - "ext-posix": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.2-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:53:42+00:00" - }, - { - "name": "sebastian/exporter", - "version": "3.1.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "73a9676f2833b9a7c36968f9d882589cd75511e6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/73a9676f2833b9a7c36968f9d882589cd75511e6", - "reference": "73a9676f2833b9a7c36968f9d882589cd75511e6", - "shasum": "" - }, - "require": { - "php": ">=7.0", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-09-14T06:00:17+00:00" - }, - { - "name": "sebastian/global-state", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "66783ce213de415b451b904bfef9dda0cf9aeae0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/66783ce213de415b451b904bfef9dda0cf9aeae0", - "reference": "66783ce213de415b451b904bfef9dda0cf9aeae0", - "shasum": "" - }, - "require": { - "php": ">=7.2", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "ext-dom": "*", - "phpunit/phpunit": "^8.0" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-08-02T09:23:32+00:00" - }, - { - "name": "sebastian/object-enumerator", - "version": "3.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", - "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", - "shasum": "" - }, - "require": { - "php": ">=7.0", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:40:27+00:00" - }, - { - "name": "sebastian/object-reflector", - "version": "1.1.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", - "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", - "shasum": "" - }, - "require": { - "php": ">=7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:37:18+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "3.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/367dcba38d6e1977be014dc4b22f47a484dac7fb", - "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb", - "shasum": "" - }, - "require": { - "php": ">=7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:34:24+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/31d35ca87926450c44eae7e2611d45a7a65ea8b3", - "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:30:19+00:00" - }, - { - "name": "sebastian/type", - "version": "1.1.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/type.git", - "reference": "0150cfbc4495ed2df3872fb31b26781e4e077eb4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/0150cfbc4495ed2df3872fb31b26781e4e077eb4", - "reference": "0150cfbc4495ed2df3872fb31b26781e4e077eb4", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Collection of value objects that represent the types of the PHP type system", - "homepage": "https://github.com/sebastianbergmann/type", - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:25:11+00:00" - }, - { - "name": "sebastian/version", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03T07:35:21+00:00" - }, - { - "name": "squizlabs/php_codesniffer", - "version": "3.7.2", - "source": { - "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", - "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", - "shasum": "" - }, - "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" - }, - "bin": [ - "bin/phpcs", - "bin/phpcbf" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Greg Sherwood", - "role": "lead" - } - ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", - "keywords": [ - "phpcs", - "standards", - "static analysis" - ], - "time": "2023-02-22T23:07:41+00:00" - }, - { - "name": "theseer/tokenizer", - "version": "1.2.2", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b2ad5003ca10d4ee50a12da31de12a5774ba6b96", - "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.2 || ^8.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - } - ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "funding": [ - { - "url": "https://github.com/theseer", - "type": "github" - } - ], - "time": "2023-11-20T00:12:19+00:00" - }, - { - "name": "wp-coding-standards/wpcs", - "version": "3.0.1", - "source": { - "type": "git", - "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", - "reference": "b4caf9689f1a0e4a4c632679a44e638c1c67aff1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/b4caf9689f1a0e4a4c632679a44e638c1c67aff1", - "reference": "b4caf9689f1a0e4a4c632679a44e638c1c67aff1", - "shasum": "" - }, - "require": { - "ext-filter": "*", - "ext-libxml": "*", - "ext-tokenizer": "*", - "ext-xmlreader": "*", - "php": ">=5.4", - "phpcsstandards/phpcsextra": "^1.1.0", - "phpcsstandards/phpcsutils": "^1.0.8", - "squizlabs/php_codesniffer": "^3.7.2" - }, - "require-dev": { - "php-parallel-lint/php-console-highlighter": "^1.0.0", - "php-parallel-lint/php-parallel-lint": "^1.3.2", - "phpcompatibility/php-compatibility": "^9.0", - "phpcsstandards/phpcsdevtools": "^1.2.0", - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" - }, - "suggest": { - "ext-iconv": "For improved results", - "ext-mbstring": "For improved results" - }, - "type": "phpcodesniffer-standard", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Contributors", - "homepage": "https://github.com/WordPress/WordPress-Coding-Standards/graphs/contributors" - } - ], - "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions", - "keywords": [ - "phpcs", - "standards", - "static analysis", - "wordpress" - ], - "funding": [ - { - "url": "https://opencollective.com/thewpcc/contribute/wp-php-63406", - "type": "custom" - } - ], - "time": "2023-09-14T07:06:09+00:00" - }, - { - "name": "wpackagist-plugin/tour-operator", - "version": "1.4.9", - "source": { - "type": "svn", - "url": "https://plugins.svn.wordpress.org/tour-operator/", - "reference": "tags/1.4.9" - }, - "dist": { - "type": "zip", - "url": "https://downloads.wordpress.org/plugin/tour-operator.1.4.9.zip" - }, - "require": { - "composer/installers": "^1.0 || ^2.0" - }, - "type": "wordpress-plugin", - "homepage": "https://wordpress.org/plugins/tour-operator/" - }, - { - "name": "wpackagist-theme/lsx", - "version": "3.0.2", - "source": { - "type": "svn", - "url": "https://themes.svn.wordpress.org/lsx/", - "reference": "3.0.2" - }, - "dist": { - "type": "zip", - "url": "https://downloads.wordpress.org/theme/lsx.3.0.2.zip" - }, - "require": { - "composer/installers": "^1.0 || ^2.0" - }, - "type": "wordpress-theme", - "homepage": "https://wordpress.org/themes/lsx/" - } - ], - "aliases": [], - "minimum-stability": "dev", - "stability-flags": { - "roave/security-advisories": 20 - }, - "prefer-stable": true, - "prefer-lowest": false, - "platform": { - "php": ">=7.2" - }, - "platform-dev": [], - "plugin-api-version": "1.1.0" -} diff --git a/gulpfile.js b/gulpfile.js deleted file mode 100644 index 8395329..0000000 --- a/gulpfile.js +++ /dev/null @@ -1,132 +0,0 @@ -const gulp = require('gulp'); -const autoprefixer = require('gulp-autoprefixer'); -const concat = require('gulp-concat'); -const gettext = require('gulp-gettext'); -const jshint = require('gulp-jshint'); -const minify = require('gulp-minify-css'); -const plumber = require('gulp-plumber'); -const rename = require('gulp-rename'); -const rtlcss = require('gulp-rtlcss'); -const sass = require('gulp-sass'); -const sort = require('gulp-sort'); -const sourcemaps = require('gulp-sourcemaps'); -const uglify = require('gulp-uglify'); -const gutil = require('gulp-util'); -const wppot = require('gulp-wp-pot'); - -const browserlist = ['last 2 version', '> 1%']; - -gulp.task('default', function() { - console.log('Use the following commands'); - console.log('--------------------------'); - console.log('gulp compile-css to compile the scss to css'); - console.log('gulp compile-js to compile the js to min.js'); - console.log('gulp watch to continue watching the files for changes'); - console.log('gulp wordpress-lang to compile the lsx-starter-plugin.pot, lsx-starter-plugin-en_EN.po and lsx-starter-plugin-en_EN.mo'); -}); - -gulp.task('styles', function () { - return gulp.src('assets/css/scss/*.scss') - .pipe(plumber({ - errorHandler: function(err) { - console.log(err); - this.emit('end'); - } - })) - .pipe(sourcemaps.init()) - .pipe(sass({ - outputStyle: 'compact', - includePaths: ['assets/css/scss'] - }).on('error', gutil.log)) - .pipe(autoprefixer({ - browsers: browserlist, - casacade: true - })) - .pipe(sourcemaps.write('maps')) - .pipe(gulp.dest('assets/css')) -}); - -gulp.task('styles-rtl', function () { - return gulp.src('assets/css/scss/*.scss') - .pipe(plumber({ - errorHandler: function(err) { - console.log(err); - this.emit('end'); - } - })) - .pipe(sass({ - outputStyle: 'compact', - includePaths: ['assets/css/scss'] - }).on('error', gutil.log)) - .pipe(autoprefixer({ - browsers: browserlist, - casacade: true - })) - .pipe(rtlcss()) - .pipe(rename({ - suffix: '-rtl' - })) - .pipe(gulp.dest('assets/css')) -}); - -gulp.task('compile-css', ['styles', 'styles-rtl']); - -gulp.task('js', function() { - return gulp.src('assets/js/src/**/*.js') - .pipe(plumber({ - errorHandler: function(err) { - console.log(err); - this.emit('end'); - } - })) - .pipe(jshint()) - .pipe(uglify()) - .pipe(rename({ - suffix: '.min' - })) - .pipe(gulp.dest('assets/js')) -}); - -gulp.task('compile-js', (['js'])); - -gulp.task('watch-css', function () { - return gulp.watch('assets/css/**/*.scss', ['compile-css']); -}); - -gulp.task('watch-js', function () { - return gulp.watch('assets/js/src/**/*.js', ['compile-js']); -}); - -gulp.task('watch', ['watch-css', 'watch-js']); - -gulp.task('wordpress-pot', function() { - return gulp.src('**/*.php') - .pipe(sort()) - .pipe(wppot({ - domain: 'lsx-starter-plugin', - package: 'lsx-starter-plugin', - bugReport: 'https://github.com/lightspeeddevelopment/lsx-starter-plugin/issues', - team: 'LightSpeed ' - })) - .pipe(gulp.dest('languages/lsx-starter-plugin.pot')) -}); - -gulp.task('wordpress-po', function() { - return gulp.src('**/*.php') - .pipe(sort()) - .pipe(wppot({ - domain: 'lsx-starter-plugin', - package: 'lsx-starter-plugin', - bugReport: 'https://github.com/lightspeeddevelopment/lsx-starter-plugin/issues', - team: 'LightSpeed ' - })) - .pipe(gulp.dest('languages/lsx-starter-plugin-en_EN.po')) -}); - -gulp.task('wordpress-po-mo', ['wordpress-po'], function() { - return gulp.src('languages/lsx-starter-plugin-en_EN.po') - .pipe(gettext()) - .pipe(gulp.dest('languages')) -}); - -gulp.task('wordpress-lang', (['wordpress-pot', 'wordpress-po-mo'])); From 2a36709aff364729bd9443448a06c1a722e7265b Mon Sep 17 00:00:00 2001 From: Warwick Date: Wed, 29 Jan 2025 13:23:38 +0200 Subject: [PATCH 07/17] Removing the uneede store files --- .DS_Store | Bin 6148 -> 6148 bytes lsx-starter-plugin.sublime-project | 16 ---------------- vendors/.DS_Store | Bin 6148 -> 6148 bytes 3 files changed, 16 deletions(-) delete mode 100644 lsx-starter-plugin.sublime-project diff --git a/.DS_Store b/.DS_Store index 47cc6c3bdf48e70b4b52364615d0b10a4b8a7a37..c9212f8457135e74ea675aa6c90b317b33ade9f0 100644 GIT binary patch delta 44 zcmZoMXfc@J&&atkU^gQp=VTrx6@E^J5{6WUT!sRM9EL=OlFbTCCs;SLbNuB80R21* AT>t<8 delta 31 ncmZoMXfc@J&&aVcU^gQp$7CKRmCgQ4J6I<+$Zuxn_{$Ffm?#OG diff --git a/lsx-starter-plugin.sublime-project b/lsx-starter-plugin.sublime-project deleted file mode 100644 index 0c44706..0000000 --- a/lsx-starter-plugin.sublime-project +++ /dev/null @@ -1,16 +0,0 @@ -{ - "folders": [ - { - "path": "/", - "folder_exclude_patterns": [".git", "node_modules", "vendor"], - "file_exclude_patterns": [] - } - ], - "build_systems": [ - { - "name": "build", - "working_dir": "${project_path}", - "shell_cmd": "./bin/build.command" - } - ] -} diff --git a/vendors/.DS_Store b/vendors/.DS_Store index 7f763c67daf49e244c2807d15f90133292bf36b9..28b639414ae79cef504bef8ecc67d8b957691bc5 100644 GIT binary patch delta 14 VcmZoMXffE}z{JR~*^%k6C;%Z*1S$Xk delta 14 VcmZoMXffE}z{JS7*^%k6C;%Z>1S
Date: Wed, 29 Jan 2025 13:27:50 +0200 Subject: [PATCH 08/17] Adding in the template loading. --- classes/class-templates.php | 79 ++++++++++++++++++++++++++++++++ templates/archive-post-type.html | 0 templates/single-post-type.html | 0 3 files changed, 79 insertions(+) create mode 100644 classes/class-templates.php create mode 100644 templates/archive-post-type.html create mode 100644 templates/single-post-type.html diff --git a/classes/class-templates.php b/classes/class-templates.php new file mode 100644 index 0000000..7ad9e64 --- /dev/null +++ b/classes/class-templates.php @@ -0,0 +1,79 @@ + [ + 'title' => __( 'Single Post Type', 'tour-operator' ), + 'description' => __( 'Displays a single', 'tour-operator' ), + 'post_types' => ['post-type'], + ], + 'archive-post-type' => [ + 'title' => __( 'Accommodation Post Type', 'tour-operator' ), + 'description' => __( 'Displays all the Post Type.', 'tour-operator' ), + 'post_types' => ['post-type'], + ] + ]; + + foreach ( $post_types as $key => $labels ) { + $args = [ + 'title' => $labels['title'], + 'description' => $labels['description'], + 'content' => $this->get_template_content( $key . '.html' ), + ]; + if ( isset( $labels['post_types'] ) ) { + $args['post_types'] = $labels['post_types']; + } + + if ( function_exists( 'register_block_template' ) ) { + register_block_template( 'lsx-starter-plugin//' . $key, $args ); + } + } + } + + /** + * Gets the PHP template file and returns the content. + * + * @param [type] $template + * @return void + */ + protected function get_template_content( $template ) { + ob_start(); + include LSX_TO_PATH . "/templates/{$template}"; + return ob_get_clean(); + } +} diff --git a/templates/archive-post-type.html b/templates/archive-post-type.html new file mode 100644 index 0000000..e69de29 diff --git a/templates/single-post-type.html b/templates/single-post-type.html new file mode 100644 index 0000000..e69de29 From bafe29e80c81375cb38542aabe68b1069a3cfcb6 Mon Sep 17 00:00:00 2001 From: Warwick Date: Wed, 29 Jan 2025 13:29:47 +0200 Subject: [PATCH 09/17] Update the templates class. --- classes/class-templates.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/classes/class-templates.php b/classes/class-templates.php index 7ad9e64..a22e2ac 100644 --- a/classes/class-templates.php +++ b/classes/class-templates.php @@ -4,8 +4,10 @@ /** * Registers our Block Templates * - * @link http://url.com + * @link https://github.com/lightspeedwp/lsx-starter-plugin/blob/master/classes/class-templates.php + * @version 1.0.0 */ + class Templates { /** From 4ee38353382302d4291d423b6445d17fc91bde51 Mon Sep 17 00:00:00 2001 From: Warwick Date: Wed, 29 Jan 2025 13:36:06 +0200 Subject: [PATCH 10/17] Fixing the template location addition --- classes/class-core.php | 10 ++++++++++ classes/class-templates.php | 12 ++++++++++-- templates/archive-post-type.html | 2 ++ templates/single-post-type.html | 2 ++ 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/classes/class-core.php b/classes/class-core.php index 0886521..4075dfe 100644 --- a/classes/class-core.php +++ b/classes/class-core.php @@ -27,6 +27,12 @@ class Core { */ public $admin; + /** + * Holds the template redirect functions + * @var object \lsx_starter_plugin\classes\Templates(); + */ + public $templates; + /** * Contructor */ @@ -58,6 +64,10 @@ private function load_classes() { require_once LSX_STARTER_PLUGIN_PATH . 'classes/class-setup.php'; $this->setup = new Setup(); + // Load plugin settings related functionality. + require_once LSX_STARTER_PLUGIN_PATH . 'classes/class-templates.php'; + $this->templates = new Templates( LSX_STARTER_PLUGIN_PATH ); + // Load plugin admin related functionality. /*require_once LSX_STARTER_PLUGIN_PATH . 'classes/class-admin.php'; $this->admin = new Admin();*/ diff --git a/classes/class-templates.php b/classes/class-templates.php index a22e2ac..d5cb5d7 100644 --- a/classes/class-templates.php +++ b/classes/class-templates.php @@ -17,6 +17,13 @@ class Templates { */ public $templates = []; + /** + * The path to the + * + * @var string + */ + public $path = ''; + /** * Initialize the plugin by setting localization, filters, and administration functions. * @@ -24,7 +31,8 @@ class Templates { * * @access private */ - public function __construct() { + public function __construct( $path ) { + $this->path = $path; add_action( 'init', [ $this, 'register_post_type_templates' ] ); } @@ -75,7 +83,7 @@ public function register_post_type_templates() { */ protected function get_template_content( $template ) { ob_start(); - include LSX_TO_PATH . "/templates/{$template}"; + include LSX_STARTER_PLUGIN_PATH . "/templates/{$template}"; return ob_get_clean(); } } diff --git a/templates/archive-post-type.html b/templates/archive-post-type.html index e69de29..cc068d4 100644 --- a/templates/archive-post-type.html +++ b/templates/archive-post-type.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/templates/single-post-type.html b/templates/single-post-type.html index e69de29..cc068d4 100644 --- a/templates/single-post-type.html +++ b/templates/single-post-type.html @@ -0,0 +1,2 @@ + + \ No newline at end of file From 5a48b93b773ddc9259de71ffa07a6dd5f2e02ea9 Mon Sep 17 00:00:00 2001 From: Warwick Date: Wed, 29 Jan 2025 15:29:26 +0200 Subject: [PATCH 11/17] Adding in the language builder scripts --- package.json | 40 +++++++--------------------------------- 1 file changed, 7 insertions(+), 33 deletions(-) diff --git a/package.json b/package.json index bc32f02..a70c933 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,11 @@ { "name": "lsx-starter-plugin", - "version": "1.1.0", - "description": "LSX Starter Plugin for building LSX theme extensions", - "main": "gulpfile.js", + "version": "1.0.0", + "description": "LSX Starter Plugin to kick start your WordPress Development", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "build-pot": "wp i18n make-pot . languages/lsx-starter-plugin.pot", + "build-mopo": "rm -R languages/lsx-starter-plugin-en_EN.mo && cp languages/lsx-starter-plugin.pot languages/lsx-starter-plugin-en_EN.po && wp i18n make-mo languages", + "translate-US": "cp languages/lsx-starter-plugin-en_EN.po languages/lsx-starter-plugin-en_US.po && cp languages/lsx-starter-plugin-en_EN.mo languages/lsx-starter-plugin-en_US.mo" }, "repository": { "type": "git", @@ -19,33 +20,6 @@ "url": "https://github.com/lightspeeddevelopment/lsx-starter-plugin/issues" }, "homepage": "https://github.com/lightspeeddevelopment/lsx-starter-plugin#readme", - "devDependencies": { - "gulp": "^5.0.0", - "gulp-autoprefixer": "^9.0.0", - "gulp-concat": "^2.6.1", - "gulp-gettext": "^0.3.0", - "gulp-jshint": "^2.1.0", - "gulp-minify-css": "^1.2.4", - "gulp-plumber": "^1.2.1", - "gulp-rename": "^2.0.0", - "gulp-rtlcss": "^2.0.0", - "gulp-sass": "^6.0.0", - "gulp-sort": "^2.0.0", - "gulp-sourcemaps": "^3.0.0", - "gulp-uglify": "^3.0.2", - "gulp-util": "^3.0.8", - "gulp-wp-pot": "^2.4.3", - "jshint": "^2.12.0" - }, - "dependencies": { - "clean-css": "^5.0.1", - "extend": "^3.0.2", - "fstream": "^1.0.12", - "lodash": "^4.17.20", - "minimatch": "^10.0.1", - "minimist": "^1.2.5", - "set-value": "^4.0.0", - "shelljs": "^0.8.4", - "tar": "^7.0.0" - } + "devDependencies": {}, + "dependencies": {} } From 7908d18f63ebd5eaa733d71c09f6a2f062c35068 Mon Sep 17 00:00:00 2001 From: Warwick Date: Wed, 29 Jan 2025 16:01:08 +0200 Subject: [PATCH 12/17] Adding in the autoloading of the classes. --- classes/class-admin.php | 12 ++------- classes/class-core.php | 53 ++++++++++++++++++++----------------- classes/class-setup.php | 2 ++ classes/class-templates.php | 17 +++++++++--- 4 files changed, 47 insertions(+), 37 deletions(-) diff --git a/classes/class-admin.php b/classes/class-admin.php index 22de53a..5a3f8a6 100644 --- a/classes/class-admin.php +++ b/classes/class-admin.php @@ -7,19 +7,11 @@ * @package lsx-starter-plugin */ class Admin { - - /** - * Holds class instance - * - * @since 1.0.0 - * - * @var object \lsx_starter_plugin\classes\Admin() - */ - protected static $instance = null; - /** * Contructor */ public function __construct() { } } + +return new Admin(); diff --git a/classes/class-core.php b/classes/class-core.php index 4075dfe..75a892b 100644 --- a/classes/class-core.php +++ b/classes/class-core.php @@ -1,6 +1,8 @@ setup = new Setup(); + public function load_classes() { + $directory = LSX_STARTER_PLUGIN_PATH . 'classes/'; + + foreach ( glob( $directory . '*.php') as $file ) { + if ( 'class-core.php' === $file ) { + continue; + } - // Load plugin settings related functionality. - require_once LSX_STARTER_PLUGIN_PATH . 'classes/class-templates.php'; - $this->templates = new Templates( LSX_STARTER_PLUGIN_PATH ); + // Extract the filename and classname without the directory path and extension + $filename = basename( $file, '.php' ); + $filename = str_replace( 'class-', '', $filename ); - // Load plugin admin related functionality. - /*require_once LSX_STARTER_PLUGIN_PATH . 'classes/class-admin.php'; - $this->admin = new Admin();*/ + // Initiate the class. + $this->classes[ $filename ] = require_once $file; + if ( 'templates' === $filename ) { + $this->classes['templates']->set_path( LSX_STARTER_PLUGIN_PATH ); + } + } } /** diff --git a/classes/class-setup.php b/classes/class-setup.php index 163f21d..13bf3dc 100644 --- a/classes/class-setup.php +++ b/classes/class-setup.php @@ -34,3 +34,5 @@ public function admin_assets() { wp_enqueue_style( 'lsx-starter-plugin-admin', LSX_STARTER_PLUGIN_URL . 'assets/css/lsx-starter-plugin-admin.css', array(), LSX_STARTER_PLUGIN_VER ); } } + +return new Setup(); diff --git a/classes/class-templates.php b/classes/class-templates.php index d5cb5d7..092567b 100644 --- a/classes/class-templates.php +++ b/classes/class-templates.php @@ -31,11 +31,20 @@ class Templates { * * @access private */ - public function __construct( $path ) { - $this->path = $path; + public function __construct() { add_action( 'init', [ $this, 'register_post_type_templates' ] ); } + /** + * Sets the path the templates should use. + * + * @param [type] $path + * @return void + */ + public function set_path( $path ) { + $this->path = $path; + } + /** * Registers our plugins templates. * @@ -83,7 +92,9 @@ public function register_post_type_templates() { */ protected function get_template_content( $template ) { ob_start(); - include LSX_STARTER_PLUGIN_PATH . "/templates/{$template}"; + include $this->path . "/templates/{$template}"; return ob_get_clean(); } } + +return new Templates(); From 194fd7b667ff037864b68554de2450b0950f6e05 Mon Sep 17 00:00:00 2001 From: Warwick Date: Wed, 29 Jan 2025 16:09:03 +0200 Subject: [PATCH 13/17] Fixing the frontend classes and the style includes for that. --- classes/class-admin.php | 17 ----------------- classes/class-core.php | 2 -- classes/class-frontend.php | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 19 deletions(-) delete mode 100644 classes/class-admin.php create mode 100644 classes/class-frontend.php diff --git a/classes/class-admin.php b/classes/class-admin.php deleted file mode 100644 index 5a3f8a6..0000000 --- a/classes/class-admin.php +++ /dev/null @@ -1,17 +0,0 @@ - Date: Wed, 29 Jan 2025 16:18:26 +0200 Subject: [PATCH 14/17] Update README.md Signed-off-by: Warwick Booth --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 65f2302..27e6215 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,10 @@ # LSX Starter Plugin LSX Starter Plugin for building LSX theme extensions. + +First download this repo to a folder on your desktop. + +Create a new Github Repository with the slug "your-plugin" +Clone your Github repo to the wp-content/plugins/your-plugin + +Next copy and paste the following files into "your-plugin" directory +![Screenshot 2025-01-29 at 16 14 53](https://github.com/user-attachments/assets/c431ae73-83fa-40e1-83b4-590d752ac784) From 14bffc946f52b207db32535a1ca58528ad3faf33 Mon Sep 17 00:00:00 2001 From: Warwick Booth Date: Wed, 29 Jan 2025 16:31:27 +0200 Subject: [PATCH 15/17] Update README.md Signed-off-by: Warwick Booth --- README.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 27e6215..fd5f21c 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,20 @@ # LSX Starter Plugin LSX Starter Plugin for building LSX theme extensions. -First download this repo to a folder on your desktop. +- First download this repo to a folder on your desktop. -Create a new Github Repository with the slug "your-plugin" -Clone your Github repo to the wp-content/plugins/your-plugin +- Create a new Github Repository with the slug "your-plugin" +- Clone your Github repo to the wp-content/plugins/your-plugin Next copy and paste the following files into "your-plugin" directory + ![Screenshot 2025-01-29 at 16 14 53](https://github.com/user-attachments/assets/c431ae73-83fa-40e1-83b4-590d752ac784) + +Do a case senstitive find and replace for the following. +- lsx_starter_plugin -> yp +- LSX_STARTER_PLUGIN -> YP +- lsx-starter-plugin -> your-plugin +- LSX Starter Plugin -> Your Plugin + +Replace the following in all filenames +- lsx-starter-plugin -> your-plugin From 8ce1769197181a5b6275e3340b71116e189832e0 Mon Sep 17 00:00:00 2001 From: Warwick Date: Wed, 29 Jan 2025 16:32:12 +0200 Subject: [PATCH 16/17] Updating the version number --- lsx-starter-plugin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lsx-starter-plugin.php b/lsx-starter-plugin.php index 32beada..c100604 100644 --- a/lsx-starter-plugin.php +++ b/lsx-starter-plugin.php @@ -4,7 +4,7 @@ * Plugin URI: https://github.com/lightspeeddevelopment/lsx-starter-plugin * Description: LSX Starter Plugin for building LSX theme extensions. * Author: LightSpeed - * Version: 1.1.0 + * Version: 2.0.0 * Author URI: https://www.lsdev.biz/ * License: GPL3 * Text Domain: lsx-starter-plugin @@ -19,7 +19,7 @@ define( 'LSX_STARTER_PLUGIN_PATH', plugin_dir_path( __FILE__ ) ); define( 'LSX_STARTER_PLUGIN_CORE', __FILE__ ); define( 'LSX_STARTER_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); -define( 'LSX_STARTER_PLUGIN_VER', '1.1.0' ); +define( 'LSX_STARTER_PLUGIN_VER', '2.0.0' ); global $CONTENT_MODEL_JSON_PATH; $CONTENT_MODEL_JSON_PATH[] = LSX_STARTER_PLUGIN_PATH; From 94f8dfc34662ac30ee66a3971234f868ef5f5897 Mon Sep 17 00:00:00 2001 From: Warwick Date: Wed, 29 Jan 2025 16:33:36 +0200 Subject: [PATCH 17/17] Fixing the sass generation --- assets/css/lsx-starter-plugin.css | 9 ++++++--- assets/css/lsx-starter-plugin.css.map | 1 + assets/css/lsx-starter-plugin.scss | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 assets/css/lsx-starter-plugin.css.map diff --git a/assets/css/lsx-starter-plugin.css b/assets/css/lsx-starter-plugin.css index 998dd8d..c80c7ca 100644 --- a/assets/css/lsx-starter-plugin.css +++ b/assets/css/lsx-starter-plugin.css @@ -1,3 +1,6 @@ -/** LSX Starter Plugin styles. @package lsx-starter-plugin */ - -/*# sourceMappingURL=maps/lsx-starter-plugin.css.map */ +/** + * LSX Starter Plugin styles. + * + * @package lsx-starter-plugin + */ +/*# sourceMappingURL=lsx-starter-plugin.css.map */ \ No newline at end of file diff --git a/assets/css/lsx-starter-plugin.css.map b/assets/css/lsx-starter-plugin.css.map new file mode 100644 index 0000000..6a88fde --- /dev/null +++ b/assets/css/lsx-starter-plugin.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["lsx-starter-plugin.scss"],"names":[],"mappings":"AAAA;;;;EAAA","file":"lsx-starter-plugin.css"} \ No newline at end of file diff --git a/assets/css/lsx-starter-plugin.scss b/assets/css/lsx-starter-plugin.scss index 245f03c..ef6935a 100644 --- a/assets/css/lsx-starter-plugin.scss +++ b/assets/css/lsx-starter-plugin.scss @@ -4,4 +4,4 @@ * @package lsx-starter-plugin */ -@import 'include-media'; +@import 'scss/include-media';