Plugin Directory

Changeset 3477683


Ignore:
Timestamp:
03/09/2026 01:20:05 AM (4 weeks ago)
Author:
rilwis
Message:

Update to version 2.0.6 from GitHub

Location:
mb-rest-api
Files:
14 edited
1 copied

Legend:

Unmodified
Added
Removed
  • mb-rest-api/tags/2.0.6/mb-rest-api.php

    r3179748 r3477683  
    44 * Plugin URI:  https://metabox.io/plugins/mb-rest-api/
    55 * Description: Add Meta Box custom fields to WordPress Rest API.
    6  * Version:     2.0.5
     6 * Version:     2.0.6
    77 * Author:      MetaBox.io
    88 * Author URI:  https://metabox.io
     
    1010 * Text Domain: mb-rest-api
    1111 * Domain Path: /languages/
     12 *
     13 * Copyright (C) 2010-2025 Tran Ngoc Tuan Anh. All rights reserved.
     14 *
     15 * This program is free software: you can redistribute it and/or modify
     16 * it under the terms of the GNU General Public License as published by
     17 * the Free Software Foundation, either version 2 of the License, or
     18 * (at your option) any later version.
     19 *
     20 * This program is distributed in the hope that it will be useful,
     21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     23 * GNU General Public License for more details.
     24 *
     25 * You should have received a copy of the GNU General Public License
     26 * along with this program. If not, see <http://www.gnu.org/licenses/>.
    1227 */
    1328
  • mb-rest-api/tags/2.0.6/readme.txt

    r3240481 r3477683  
    44Tags: meta box, custom fields, rest api
    55Requires at least: 4.1
    6 Tested up to: 6.6.2
    7 Stable tag: 2.0.5
     6Tested up to: 6.9.1
     7Stable tag: 2.0.6
    88Requires PHP: 7.0
    99License: GPLv2 or later
     
    3030If you like this plugin, you might also like our other WordPress products:
    3131
    32 - [Meta Box](https://metabox.io) - A powerful WordPress plugin for creating custom post types and custom fields.
    3332- [Slim SEO](https://wpslimseo.com) - A fast, lightweight and full-featured SEO plugin for WordPress with minimal configuration.
    34 - [Slim SEO Schema](https://wpslimseo.com/products/slim-seo-schema/) - An advanced, powerful and flexible plugin to add schemas to WordPress.
    35 - [Slim SEO Link Manager](https://wpslimseo.com/products/slim-seo-link-manager/) - Build internal link easier in WordPress with real-time reports.
     33- [Falcon](https://wpfalcon.pro) - A lightweight companion for making WordPress faster, cleaner, and more secure.
    3634- [GretaThemes](https://gretathemes.com) - Free and premium WordPress themes that clean, simple and just work.
    3735- [Auto Listings](https://wpautolistings.com) - A car sale and dealership plugin for WordPress.
     
    5351== Changelog ==
    5452
     53= 2.0.6 - 2026-03-09 =
     54- Fix updating WooCommerce products
     55
    5556= 2.0.5 - 2024-11-01 =
    56 Fix direct file access
     57- Fix direct file access
    5758
    5859= 2.0.4 - 2024-08-19 =
    59 Fix running PHP Codesniffer when installing & autoload the plugin's main file via Composer
     60- Fix running PHP Codesniffer when installing & autoload the plugin's main file via Composer
    6061
    6162= 2.0.3 - 2024-07-22 =
  • mb-rest-api/tags/2.0.6/src/Post.php

    r3110789 r3477683  
    66class Post extends Base {
    77    public function update( $data, $post ) {
    8         if ( property_exists( $post, 'post_type' ) && 'product' === $post->post_type ) {
     8        if ( is_object( $post ) && method_exists( $post, 'get_id' ) && ! ( $post instanceof \WP_Post ) ) {
    99            $post_id = $post->get_id();
     10        } elseif ( $post instanceof \WP_Post ) {
     11            $post_id = $post->ID;
    1012        } else {
    11             $post_id = $post->ID;
     13            // Fallback value
     14            $post_id = isset( $post->ID ) ? $post->ID : ( isset( $post['id'] ) ? $post['id'] : 0 );
    1215        }
    1316
  • mb-rest-api/tags/2.0.6/vendor/autoload.php

    r2978013 r3477683  
    1515        }
    1616    }
    17     trigger_error(
    18         $err,
    19         E_USER_ERROR
    20     );
     17    throw new RuntimeException($err);
    2118}
    2219
  • mb-rest-api/tags/2.0.6/vendor/composer/InstalledVersions.php

    r2978013 r3477683  
    2828{
    2929    /**
     30     * @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to
     31     * @internal
     32     */
     33    private static $selfDir = null;
     34
     35    /**
    3036     * @var mixed[]|null
    3137     * @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
    3238     */
    3339    private static $installed;
     40
     41    /**
     42     * @var bool
     43     */
     44    private static $installedIsLocalDir;
    3445
    3546    /**
     
    310321        self::$installed = $data;
    311322        self::$installedByVendor = array();
     323
     324        // when using reload, we disable the duplicate protection to ensure that self::$installed data is
     325        // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
     326        // so we have to assume it does not, and that may result in duplicate data being returned when listing
     327        // all installed packages for example
     328        self::$installedIsLocalDir = false;
     329    }
     330
     331    /**
     332     * @return string
     333     */
     334    private static function getSelfDir()
     335    {
     336        if (self::$selfDir === null) {
     337            self::$selfDir = strtr(__DIR__, '\\', '/');
     338        }
     339
     340        return self::$selfDir;
    312341    }
    313342
     
    323352
    324353        $installed = array();
     354        $copiedLocalDir = false;
    325355
    326356        if (self::$canGetVendors) {
     357            $selfDir = self::getSelfDir();
    327358            foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
     359                $vendorDir = strtr($vendorDir, '\\', '/');
    328360                if (isset(self::$installedByVendor[$vendorDir])) {
    329361                    $installed[] = self::$installedByVendor[$vendorDir];
     
    331363                    /** @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[]}>} $required */
    332364                    $required = require $vendorDir.'/composer/installed.php';
    333                     $installed[] = self::$installedByVendor[$vendorDir] = $required;
    334                     if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
    335                         self::$installed = $installed[count($installed) - 1];
     365                    self::$installedByVendor[$vendorDir] = $required;
     366                    $installed[] = $required;
     367                    if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
     368                        self::$installed = $required;
     369                        self::$installedIsLocalDir = true;
    336370                    }
     371                }
     372                if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
     373                    $copiedLocalDir = true;
    337374                }
    338375            }
     
    351388        }
    352389
    353         if (self::$installed !== array()) {
     390        if (self::$installed !== array() && !$copiedLocalDir) {
    354391            $installed[] = self::$installed;
    355392        }
  • mb-rest-api/tags/2.0.6/vendor/composer/autoload_static.php

    r2978013 r3477683  
    88{
    99    public static $prefixLengthsPsr4 = array (
    10         'M' => 
     10        'M' =>
    1111        array (
    1212            'MetaBox\\RestApi\\' => 16,
     
    1515
    1616    public static $prefixDirsPsr4 = array (
    17         'MetaBox\\RestApi\\' => 
     17        'MetaBox\\RestApi\\' =>
    1818        array (
    1919            0 => __DIR__ . '/../..' . '/src',
  • mb-rest-api/tags/2.0.6/vendor/composer/installed.php

    r3179748 r3477683  
    22    'root' => array(
    33        'name' => 'wpmetabox/mb-rest-api',
    4         'pretty_version' => '2.0.5',
    5         'version' => '2.0.5.0',
    6         'reference' => '67a67db7cd078f1994bcbb373b2777a38f1333aa',
     4        'pretty_version' => '2.0.6',
     5        'version' => '2.0.6.0',
     6        'reference' => '0fd0efb5eb49147f247bd729d76c795ea8764471',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    1212    'versions' => array(
    1313        'wpmetabox/mb-rest-api' => array(
    14             'pretty_version' => '2.0.5',
    15             'version' => '2.0.5.0',
    16             'reference' => '67a67db7cd078f1994bcbb373b2777a38f1333aa',
     14            'pretty_version' => '2.0.6',
     15            'version' => '2.0.6.0',
     16            'reference' => '0fd0efb5eb49147f247bd729d76c795ea8764471',
    1717            'type' => 'wordpress-plugin',
    1818            'install_path' => __DIR__ . '/../../',
  • mb-rest-api/trunk/mb-rest-api.php

    r3179748 r3477683  
    44 * Plugin URI:  https://metabox.io/plugins/mb-rest-api/
    55 * Description: Add Meta Box custom fields to WordPress Rest API.
    6  * Version:     2.0.5
     6 * Version:     2.0.6
    77 * Author:      MetaBox.io
    88 * Author URI:  https://metabox.io
     
    1010 * Text Domain: mb-rest-api
    1111 * Domain Path: /languages/
     12 *
     13 * Copyright (C) 2010-2025 Tran Ngoc Tuan Anh. All rights reserved.
     14 *
     15 * This program is free software: you can redistribute it and/or modify
     16 * it under the terms of the GNU General Public License as published by
     17 * the Free Software Foundation, either version 2 of the License, or
     18 * (at your option) any later version.
     19 *
     20 * This program is distributed in the hope that it will be useful,
     21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     23 * GNU General Public License for more details.
     24 *
     25 * You should have received a copy of the GNU General Public License
     26 * along with this program. If not, see <http://www.gnu.org/licenses/>.
    1227 */
    1328
  • mb-rest-api/trunk/readme.txt

    r3240481 r3477683  
    44Tags: meta box, custom fields, rest api
    55Requires at least: 4.1
    6 Tested up to: 6.6.2
    7 Stable tag: 2.0.5
     6Tested up to: 6.9.1
     7Stable tag: 2.0.6
    88Requires PHP: 7.0
    99License: GPLv2 or later
     
    3030If you like this plugin, you might also like our other WordPress products:
    3131
    32 - [Meta Box](https://metabox.io) - A powerful WordPress plugin for creating custom post types and custom fields.
    3332- [Slim SEO](https://wpslimseo.com) - A fast, lightweight and full-featured SEO plugin for WordPress with minimal configuration.
    34 - [Slim SEO Schema](https://wpslimseo.com/products/slim-seo-schema/) - An advanced, powerful and flexible plugin to add schemas to WordPress.
    35 - [Slim SEO Link Manager](https://wpslimseo.com/products/slim-seo-link-manager/) - Build internal link easier in WordPress with real-time reports.
     33- [Falcon](https://wpfalcon.pro) - A lightweight companion for making WordPress faster, cleaner, and more secure.
    3634- [GretaThemes](https://gretathemes.com) - Free and premium WordPress themes that clean, simple and just work.
    3735- [Auto Listings](https://wpautolistings.com) - A car sale and dealership plugin for WordPress.
     
    5351== Changelog ==
    5452
     53= 2.0.6 - 2026-03-09 =
     54- Fix updating WooCommerce products
     55
    5556= 2.0.5 - 2024-11-01 =
    56 Fix direct file access
     57- Fix direct file access
    5758
    5859= 2.0.4 - 2024-08-19 =
    59 Fix running PHP Codesniffer when installing & autoload the plugin's main file via Composer
     60- Fix running PHP Codesniffer when installing & autoload the plugin's main file via Composer
    6061
    6162= 2.0.3 - 2024-07-22 =
  • mb-rest-api/trunk/src/Post.php

    r3110789 r3477683  
    66class Post extends Base {
    77    public function update( $data, $post ) {
    8         if ( property_exists( $post, 'post_type' ) && 'product' === $post->post_type ) {
     8        if ( is_object( $post ) && method_exists( $post, 'get_id' ) && ! ( $post instanceof \WP_Post ) ) {
    99            $post_id = $post->get_id();
     10        } elseif ( $post instanceof \WP_Post ) {
     11            $post_id = $post->ID;
    1012        } else {
    11             $post_id = $post->ID;
     13            // Fallback value
     14            $post_id = isset( $post->ID ) ? $post->ID : ( isset( $post['id'] ) ? $post['id'] : 0 );
    1215        }
    1316
  • mb-rest-api/trunk/vendor/autoload.php

    r2978013 r3477683  
    1515        }
    1616    }
    17     trigger_error(
    18         $err,
    19         E_USER_ERROR
    20     );
     17    throw new RuntimeException($err);
    2118}
    2219
  • mb-rest-api/trunk/vendor/composer/InstalledVersions.php

    r2978013 r3477683  
    2828{
    2929    /**
     30     * @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to
     31     * @internal
     32     */
     33    private static $selfDir = null;
     34
     35    /**
    3036     * @var mixed[]|null
    3137     * @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
    3238     */
    3339    private static $installed;
     40
     41    /**
     42     * @var bool
     43     */
     44    private static $installedIsLocalDir;
    3445
    3546    /**
     
    310321        self::$installed = $data;
    311322        self::$installedByVendor = array();
     323
     324        // when using reload, we disable the duplicate protection to ensure that self::$installed data is
     325        // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
     326        // so we have to assume it does not, and that may result in duplicate data being returned when listing
     327        // all installed packages for example
     328        self::$installedIsLocalDir = false;
     329    }
     330
     331    /**
     332     * @return string
     333     */
     334    private static function getSelfDir()
     335    {
     336        if (self::$selfDir === null) {
     337            self::$selfDir = strtr(__DIR__, '\\', '/');
     338        }
     339
     340        return self::$selfDir;
    312341    }
    313342
     
    323352
    324353        $installed = array();
     354        $copiedLocalDir = false;
    325355
    326356        if (self::$canGetVendors) {
     357            $selfDir = self::getSelfDir();
    327358            foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
     359                $vendorDir = strtr($vendorDir, '\\', '/');
    328360                if (isset(self::$installedByVendor[$vendorDir])) {
    329361                    $installed[] = self::$installedByVendor[$vendorDir];
     
    331363                    /** @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[]}>} $required */
    332364                    $required = require $vendorDir.'/composer/installed.php';
    333                     $installed[] = self::$installedByVendor[$vendorDir] = $required;
    334                     if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
    335                         self::$installed = $installed[count($installed) - 1];
     365                    self::$installedByVendor[$vendorDir] = $required;
     366                    $installed[] = $required;
     367                    if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
     368                        self::$installed = $required;
     369                        self::$installedIsLocalDir = true;
    336370                    }
     371                }
     372                if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
     373                    $copiedLocalDir = true;
    337374                }
    338375            }
     
    351388        }
    352389
    353         if (self::$installed !== array()) {
     390        if (self::$installed !== array() && !$copiedLocalDir) {
    354391            $installed[] = self::$installed;
    355392        }
  • mb-rest-api/trunk/vendor/composer/autoload_static.php

    r2978013 r3477683  
    88{
    99    public static $prefixLengthsPsr4 = array (
    10         'M' => 
     10        'M' =>
    1111        array (
    1212            'MetaBox\\RestApi\\' => 16,
     
    1515
    1616    public static $prefixDirsPsr4 = array (
    17         'MetaBox\\RestApi\\' => 
     17        'MetaBox\\RestApi\\' =>
    1818        array (
    1919            0 => __DIR__ . '/../..' . '/src',
  • mb-rest-api/trunk/vendor/composer/installed.php

    r3179748 r3477683  
    22    'root' => array(
    33        'name' => 'wpmetabox/mb-rest-api',
    4         'pretty_version' => '2.0.5',
    5         'version' => '2.0.5.0',
    6         'reference' => '67a67db7cd078f1994bcbb373b2777a38f1333aa',
     4        'pretty_version' => '2.0.6',
     5        'version' => '2.0.6.0',
     6        'reference' => '0fd0efb5eb49147f247bd729d76c795ea8764471',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    1212    'versions' => array(
    1313        'wpmetabox/mb-rest-api' => array(
    14             'pretty_version' => '2.0.5',
    15             'version' => '2.0.5.0',
    16             'reference' => '67a67db7cd078f1994bcbb373b2777a38f1333aa',
     14            'pretty_version' => '2.0.6',
     15            'version' => '2.0.6.0',
     16            'reference' => '0fd0efb5eb49147f247bd729d76c795ea8764471',
    1717            'type' => 'wordpress-plugin',
    1818            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.