Plugin Directory

Changeset 2952798


Ignore:
Timestamp:
08/13/2023 01:27:09 AM (3 years ago)
Author:
codingchicken
Message:

New version

Location:
importer-for-crocoblock-jetengine/tags/1.2.1
Files:
16 edited
1 copied

Legend:

Unmodified
Added
Removed
  • importer-for-crocoblock-jetengine/tags/1.2.1/importer-for-crocoblock-jetengine.php

    r2887267 r2952798  
    33Plugin Name: Coding Chicken - JetEngine Importer
    44Description: A handy importer for JetEngine Meta Box fields - Requires WP All Import and JetEngine
    5 Version: 1.2
     5Version: 1.2.1
    66Author: Coding Chicken
    77Author URI: https://codingchicken.com
     
    2828const IMPORTER_JETENGINE_PREFIX = 'cc_jetengine_importer_';
    2929
    30 const IMPORTER_JETENGINE_VERSION = '1.2';
     30const IMPORTER_JETENGINE_VERSION = '1.2.1';
    3131
    3232// Require Composer autoloader.
  • importer-for-crocoblock-jetengine/tags/1.2.1/readme.txt

    r2890884 r2952798  
    44Tags: import, jetengine, crocoblock, meta box, xml, csv, metabox, wp all import
    55Requires at least: 5.0
    6 Tested up to: 6.1
    7 Stable tag: 1.2
     6Tested up to: 6.3
     7Stable tag: 1.2.1
    88Requires PHP: 7.2.5
    99License: GPLv2 or later
     
    6767
    6868== Changelog ==
     69
     70= 1.2.1 =
     71* bug fix: correct importing to checkboxes with the 'Save as array' option enabled
     72
    6973= 1.2 =
    7074* bug fix: resolve issue where some JetEngine objects may not appear in the import configuration
  • importer-for-crocoblock-jetengine/tags/1.2.1/src/FieldFactory/Fields/Checkbox.php

    r2824714 r2952798  
    4141
    4242            // Set any needed field options.
    43             $field_options = '';
     43            if( isset($this->data['is_array']) && $this->data['is_array']){
     44                $field_options = 'array-1';
     45            }else {
     46                $field_options = 'array-0';
     47            }
    4448
    4549            $options = $this->get_options();
     
    6064        private function prepareValue($fieldData){
    6165
    62             $values = explode(',', $fieldData['value']);
     66            $values         = explode( ',', $fieldData['value'] );
     67            $values         = array_map('trim', $values);
    6368            $formattedValue = [];
    6469
    65             // Every option needs a true/false indicator to show if it's checked.
    66             foreach($this->get_options() as $key => $option){
    67                 if( in_array($key, $values )){
    68                     $formattedValue[$key] = 'true'; // Expects a text value.
    69                 }else{
    70                     $formattedValue[$key] = 'false'; // Expects a text value.
     70            if( isset($fieldData['field_options']['array']) && $fieldData['field_options']['array'] ){
     71
     72                // When the option to store as an array is set we don't need to do anything more.
     73                $formattedValue = $values;
     74
     75            }else {
     76
     77                // Every option needs a true/false indicator to show if it's checked if not set to save as simple array.
     78                foreach ( $this->get_options() as $key => $option ) {
     79                    if ( in_array( $key, $values ) ) {
     80                        $formattedValue[ $key ] = 'true'; // Expects a text value.
     81                    } else {
     82                        $formattedValue[ $key ] = 'false'; // Expects a text value.
     83                    }
    7184                }
     85
    7286            }
    7387
  • importer-for-crocoblock-jetengine/tags/1.2.1/vendor/autoload.php

    r2824714 r2952798  
    33// autoload.php @generated by Composer
    44
     5if (PHP_VERSION_ID < 50600) {
     6    if (!headers_sent()) {
     7        header('HTTP/1.1 500 Internal Server Error');
     8    }
     9    $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
     10    if (!ini_get('display_errors')) {
     11        if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
     12            fwrite(STDERR, $err);
     13        } elseif (!headers_sent()) {
     14            echo $err;
     15        }
     16    }
     17    trigger_error(
     18        $err,
     19        E_USER_ERROR
     20    );
     21}
     22
    523require_once __DIR__ . '/composer/autoload_real.php';
    624
  • importer-for-crocoblock-jetengine/tags/1.2.1/vendor/composer/ClassLoader.php

    r2824714 r2952798  
    4343class ClassLoader
    4444{
     45    /** @var \Closure(string):void */
     46    private static $includeFile;
     47
    4548    /** @var ?string */
    4649    private $vendorDir;
     
    107110    {
    108111        $this->vendorDir = $vendorDir;
     112        self::initializeIncludeClosure();
    109113    }
    110114
     
    426430    {
    427431        if ($file = $this->findFile($class)) {
    428             includeFile($file);
     432            $includeFile = self::$includeFile;
     433            $includeFile($file);
    429434
    430435            return true;
     
    556561        return false;
    557562    }
     563
     564    /**
     565     * @return void
     566     */
     567    private static function initializeIncludeClosure()
     568    {
     569        if (self::$includeFile !== null) {
     570            return;
     571        }
     572
     573        /**
     574         * Scope isolated include.
     575         *
     576         * Prevents access to $this/self from included files.
     577         *
     578         * @param  string $file
     579         * @return void
     580         */
     581        self::$includeFile = \Closure::bind(static function($file) {
     582            include $file;
     583        }, null, null);
     584    }
    558585}
    559 
    560 /**
    561  * Scope isolated include.
    562  *
    563  * Prevents access to $this/self from included files.
    564  *
    565  * @param  string $file
    566  * @return void
    567  * @private
    568  */
    569 function includeFile($file)
    570 {
    571     include $file;
    572 }
  • importer-for-crocoblock-jetengine/tags/1.2.1/vendor/composer/InstalledVersions.php

    r2824714 r2952798  
    2222 *
    2323 * To require its presence, you can require `composer-runtime-api ^2.0`
     24 *
     25 * @final
    2426 */
    2527class InstalledVersions
     
    2729    /**
    2830     * @var mixed[]|null
    29      * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
     31     * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
    3032     */
    3133    private static $installed;
     
    3840    /**
    3941     * @var array[]
    40      * @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
     42     * @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
    4143     */
    4244    private static $installedByVendor = array();
     
    242244    /**
    243245     * @return array
    244      * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
     246     * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
    245247     */
    246248    public static function getRootPackage()
     
    256258     * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
    257259     * @return array[]
    258      * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
     260     * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
    259261     */
    260262    public static function getRawData()
     
    279281     *
    280282     * @return array[]
    281      * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
     283     * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
    282284     */
    283285    public static function getAllRawData()
     
    302304     * @return void
    303305     *
    304      * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
     306     * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
    305307     */
    306308    public static function reload($data)
     
    312314    /**
    313315     * @return array[]
    314      * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
     316     * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
    315317     */
    316318    private static function getInstalled()
  • importer-for-crocoblock-jetengine/tags/1.2.1/vendor/composer/LICENSE

    r2824714 r2952798  
     1
    12Copyright (c) Nils Adermann, Jordi Boggiano
    23
     
    1819OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    1920THE SOFTWARE.
     21
  • importer-for-crocoblock-jetengine/tags/1.2.1/vendor/composer/autoload_classmap.php

    r2824714 r2952798  
    33// autoload_classmap.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • importer-for-crocoblock-jetengine/tags/1.2.1/vendor/composer/autoload_files.php

    r2824714 r2952798  
    33// autoload_files.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • importer-for-crocoblock-jetengine/tags/1.2.1/vendor/composer/autoload_namespaces.php

    r2824714 r2952798  
    33// autoload_namespaces.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • importer-for-crocoblock-jetengine/tags/1.2.1/vendor/composer/autoload_psr4.php

    r2824714 r2952798  
    33// autoload_psr4.php @generated by Composer
    44
    5 $vendorDir = dirname(dirname(__FILE__));
     5$vendorDir = dirname(__DIR__);
    66$baseDir = dirname($vendorDir);
    77
  • importer-for-crocoblock-jetengine/tags/1.2.1/vendor/composer/autoload_real.php

    r2824714 r2952798  
    2424
    2525        spl_autoload_register(array('ComposerAutoloaderInit359f82cc13b2aa7b86b36aa4d120b17b', 'loadClassLoader'), true, true);
    26         self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
     26        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    2727        spl_autoload_unregister(array('ComposerAutoloaderInit359f82cc13b2aa7b86b36aa4d120b17b', 'loadClassLoader'));
    2828
    29         $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
    30         if ($useStaticLoader) {
    31             require __DIR__ . '/autoload_static.php';
    32 
    33             call_user_func(\Composer\Autoload\ComposerStaticInit359f82cc13b2aa7b86b36aa4d120b17b::getInitializer($loader));
    34         } else {
    35             $map = require __DIR__ . '/autoload_namespaces.php';
    36             foreach ($map as $namespace => $path) {
    37                 $loader->set($namespace, $path);
    38             }
    39 
    40             $map = require __DIR__ . '/autoload_psr4.php';
    41             foreach ($map as $namespace => $path) {
    42                 $loader->setPsr4($namespace, $path);
    43             }
    44 
    45             $classMap = require __DIR__ . '/autoload_classmap.php';
    46             if ($classMap) {
    47                 $loader->addClassMap($classMap);
    48             }
    49         }
     29        require __DIR__ . '/autoload_static.php';
     30        call_user_func(\Composer\Autoload\ComposerStaticInit359f82cc13b2aa7b86b36aa4d120b17b::getInitializer($loader));
    5031
    5132        $loader->register(true);
    5233
    53         if ($useStaticLoader) {
    54             $includeFiles = Composer\Autoload\ComposerStaticInit359f82cc13b2aa7b86b36aa4d120b17b::$files;
    55         } else {
    56             $includeFiles = require __DIR__ . '/autoload_files.php';
    57         }
    58         foreach ($includeFiles as $fileIdentifier => $file) {
    59             composerRequire359f82cc13b2aa7b86b36aa4d120b17b($fileIdentifier, $file);
     34        $filesToLoad = \Composer\Autoload\ComposerStaticInit359f82cc13b2aa7b86b36aa4d120b17b::$files;
     35        $requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
     36            if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
     37                $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
     38
     39                require $file;
     40            }
     41        }, null, null);
     42        foreach ($filesToLoad as $fileIdentifier => $file) {
     43            $requireFile($fileIdentifier, $file);
    6044        }
    6145
     
    6347    }
    6448}
    65 
    66 /**
    67  * @param string $fileIdentifier
    68  * @param string $file
    69  * @return void
    70  */
    71 function composerRequire359f82cc13b2aa7b86b36aa4d120b17b($fileIdentifier, $file)
    72 {
    73     if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
    74         $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
    75 
    76         require $file;
    77     }
    78 }
  • importer-for-crocoblock-jetengine/tags/1.2.1/vendor/composer/installed.json

    r2824714 r2952798  
    88                "type": "git",
    99                "url": "https://github.com/CodingChicken-com/wp-all-import-rapid-addon.git",
    10                 "reference": "5acb6bf4b7185ca2e590bf21aeea3b7a2e10c094"
     10                "reference": "2b13ede62e701e64f851be08345fc43a664eb55a"
    1111            },
    1212            "dist": {
    1313                "type": "zip",
    14                 "url": "https://api.github.com/repos/CodingChicken-com/wp-all-import-rapid-addon/zipball/5acb6bf4b7185ca2e590bf21aeea3b7a2e10c094",
    15                 "reference": "5acb6bf4b7185ca2e590bf21aeea3b7a2e10c094",
     14                "url": "https://api.github.com/repos/CodingChicken-com/wp-all-import-rapid-addon/zipball/2b13ede62e701e64f851be08345fc43a664eb55a",
     15                "reference": "2b13ede62e701e64f851be08345fc43a664eb55a",
    1616                "shasum": ""
    1717            },
    18             "time": "2022-11-13T20:00:20+00:00",
     18            "time": "2023-07-09T02:45:21+00:00",
    1919            "default-branch": true,
    2020            "type": "library",
     
    2626            },
    2727            "license": [
    28                 "GPL 2.0"
     28                "GPL-2.0-only"
    2929            ],
    3030            "description": "Rapid Add-On API for WP All Import",
  • importer-for-crocoblock-jetengine/tags/1.2.1/vendor/composer/installed.php

    r2887267 r2952798  
    11<?php return array(
    22    'root' => array(
     3        'name' => 'coding-chicken/importer-for-crocoblock-jetengine',
    34        'pretty_version' => 'dev-master',
    45        'version' => 'dev-master',
     6        'reference' => '8b613f4e4f937c2b4f1a8cfe02736b40441962c9',
    57        'type' => 'library',
    68        'install_path' => __DIR__ . '/../../',
    79        'aliases' => array(),
    8         'reference' => 'e9a6e95a74220b1bf0d161d73c10946a3bb1eaca',
    9         'name' => 'coding-chicken/importer-for-crocoblock-jetengine',
    1010        'dev' => true,
    1111    ),
     
    1414            'pretty_version' => 'dev-master',
    1515            'version' => 'dev-master',
     16            'reference' => '8b613f4e4f937c2b4f1a8cfe02736b40441962c9',
    1617            'type' => 'library',
    1718            'install_path' => __DIR__ . '/../../',
    1819            'aliases' => array(),
    19             'reference' => 'e9a6e95a74220b1bf0d161d73c10946a3bb1eaca',
    2020            'dev_requirement' => false,
    2121        ),
     
    2323            'pretty_version' => 'dev-master',
    2424            'version' => 'dev-master',
     25            'reference' => '2b13ede62e701e64f851be08345fc43a664eb55a',
    2526            'type' => 'library',
    2627            'install_path' => __DIR__ . '/../soflyy/wp-all-import-rapid-addon',
     
    2829                0 => '9999999-dev',
    2930            ),
    30             'reference' => '5acb6bf4b7185ca2e590bf21aeea3b7a2e10c094',
    3131            'dev_requirement' => false,
    3232        ),
  • importer-for-crocoblock-jetengine/tags/1.2.1/vendor/soflyy/wp-all-import-rapid-addon/composer.json

    r2824714 r2952798  
    33    "description": "Rapid Add-On API for WP All Import",
    44    "type": "library",
    5     "license": "GPL 2.0",
     5    "license": "GPL-2.0-only",
    66    "require": {},
    77    "autoload": {
  • importer-for-crocoblock-jetengine/tags/1.2.1/vendor/soflyy/wp-all-import-rapid-addon/rapid-addon.php

    r2824714 r2952798  
    66 * @copyright   Copyright (c) 2014, Soflyy
    77 * @license     http://opensource.org/licenses/gpl-2.0.php GNU Public License
    8  * @version     2.0
     8 * @version     2.0.1
    99 * @author      Modified version by Coding Chicken
    1010 */
     
    368368                            case 'image':
    369369
     370                                // Get allowed mime types.
     371                                $mimes = \get_allowed_mime_types();
     372
     373                                // Get image mimes.
     374                                $images_exts = [];
     375
     376                                // Get list of image extensions.
     377                                foreach( $mimes as $ext => $mime ){
     378                                    if( strpos($mime, 'image/') !== false ){
     379                                        $exts = explode('|', $ext);
     380
     381                                        foreach( $exts as $ext ){
     382                                            $images_exts[] = $ext;
     383                                        }
     384                                    }
     385                                }
     386
    370387                                // import the specified image, then set the value of the field to the image ID in the media library
    371388
     
    388405                                        $download = $import_options['download_image'][$field_slug];
    389406
    390                                         $uploaded_image = \PMXI_API::upload_image($post_id, $image_url_or_path, $download, $importData['logger'], true, "", "images", true, $importData['articleData']);
     407                                        // Determine if target file is supported image or some other file type.
     408                                        $ext = pathinfo($image_url_or_path, PATHINFO_EXTENSION);
     409                                        if( in_array($ext, $images_exts)){
     410                                            $file_type = 'images';
     411                                        }else{
     412                                            $file_type = 'files';
     413                                        }
     414
     415                                        $uploaded_image = \PMXI_API::upload_image($post_id, $image_url_or_path, $download, $importData['logger'], true, "", $file_type, true, $importData['articleData']);
    391416
    392417                                        $data[$field_slug][$key][] = array(
Note: See TracChangeset for help on using the changeset viewer.