Skip to content

Commit

Permalink
chore(release): 2.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
kristos80 committed Mar 28, 2024
1 parent ee88dd8 commit 6dc194d
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 18 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
"MergeOrg\\WpPluginSort\\": "src"
}
},
"version": "2.4.0"
"version": "2.4.1"
}
2 changes: 1 addition & 1 deletion merge-org-sort.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Description: 📊Sort - Sales Order Ranking Tool | Powered by Merge
* Author: Merge
* Author URI: https://github.com/merge-org
* Version: 2.4.0
* Version: 2.4.1
* Text Domain: merge-org-sort
* Domain Path: /languages
* Requires PHP: 7.4
Expand Down
2 changes: 2 additions & 0 deletions src/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ final class Container {

/**
* @param string $key
*
* @return mixed
*/
public static function get( string $key ) {
Expand All @@ -53,6 +54,7 @@ public static function get( string $key ) {
self::$container[ ProductSalesPeriodsUpdater::class ] = $productSalesPeriodsUpdater;
self::$container[ ProductsSalesPeriodsUpdater::class ] = $productsSalesPeriodsUpdater;
self::$container[ RemainingOrdersNoticer::class ] = $remainingOrdersNoticer;
self::$container['production'] = ( $_ENV['APP_ENV'] ?? 'production' ) === 'production';

self::$got = true;
}
Expand Down
14 changes: 11 additions & 3 deletions src/Model/ActionsRegistrar.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ final class ActionsRegistrar {
* @return void
*/
public static function register(): void {
$_ENV['MERGE_ORG_SORT_PRO'] = true;

add_action(
'init',
self::RECORD_ORDERS_AND_UPDATE_PRODUCTS_ACTION['action'],
Expand Down Expand Up @@ -168,6 +170,7 @@ public static function displayRemainingOrdersNotice(): void {

/**
* @param array<string, string> $columns
*
* @return array<string, string>
*/
public static function filterProductColumns( array $columns ): array {
Expand All @@ -181,6 +184,7 @@ public static function filterProductColumns( array $columns ): array {

/**
* @param array<string, string> $columns
*
* @return array<string, string>
*/
public static function filterSortableProductColumns( array $columns ): array {
Expand All @@ -193,7 +197,7 @@ public static function filterSortableProductColumns( array $columns ): array {
$columnsForSorting = array();
$index = 0;
foreach ( $columnsForSorting_ as $item => $value ) {
if ( $index === 0 ) {
if ( $index === 0 || ( $_ENV['MERGE_ORG_SORT_PRO'] ?? false ) ) {
$columnsForSorting[ $item ] = $value;
}

Expand All @@ -206,6 +210,7 @@ public static function filterSortableProductColumns( array $columns ): array {
/**
* @param string $column
* @param int $postId
*
* @return void
*/
public static function showSalesInProductCell( string $column, int $postId ) {
Expand All @@ -229,8 +234,10 @@ public static function showSalesInProductCell( string $column, int $postId ) {
$constants->getSalesPeriodPurchaseMetaKey( 365 ),
);

if ( in_array( $column, $disallowedColumns ) && ( self::$showSalesIndex[ $column ] ?? 0 ) >= 3 ) {
echo '<pre>PRO</pre>';
if ( ! ( $_ENV['MERGE_ORG_SORT_PRO'] ?? false ) &&
in_array( $column, $disallowedColumns ) &&
( self::$showSalesIndex[ $column ] ?? 0 ) >= 3 ) {
echo "<code style='font-size: .75em'>PRO</code>";

return;
}
Expand All @@ -242,6 +249,7 @@ public static function showSalesInProductCell( string $column, int $postId ) {

/**
* @param WP_Query $query
*
* @return void
*/
public static function hookSalesMetaKeyInWpQuery( WP_Query $query ): void {
Expand Down
2 changes: 1 addition & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInitaedd9ed476b059723745ad165a56b7af::getLoader();
return ComposerAutoloaderInit2be53ce21e2ba3efdf634ddb8f7bef9b::getLoader();
8 changes: 4 additions & 4 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInitaedd9ed476b059723745ad165a56b7af
class ComposerAutoloaderInit2be53ce21e2ba3efdf634ddb8f7bef9b
{
private static $loader;

Expand All @@ -24,12 +24,12 @@ public static function getLoader()

require __DIR__ . '/platform_check.php';

spl_autoload_register(array('ComposerAutoloaderInitaedd9ed476b059723745ad165a56b7af', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit2be53ce21e2ba3efdf634ddb8f7bef9b', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInitaedd9ed476b059723745ad165a56b7af', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit2be53ce21e2ba3efdf634ddb8f7bef9b', 'loadClassLoader'));

require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitaedd9ed476b059723745ad165a56b7af::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit2be53ce21e2ba3efdf634ddb8f7bef9b::getInitializer($loader));

$loader->register(true);

Expand Down
8 changes: 4 additions & 4 deletions vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Composer\Autoload;

class ComposerStaticInitaedd9ed476b059723745ad165a56b7af
class ComposerStaticInit2be53ce21e2ba3efdf634ddb8f7bef9b
{
public static $prefixLengthsPsr4 = array (
'M' =>
Expand All @@ -27,9 +27,9 @@ class ComposerStaticInitaedd9ed476b059723745ad165a56b7af
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitaedd9ed476b059723745ad165a56b7af::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitaedd9ed476b059723745ad165a56b7af::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitaedd9ed476b059723745ad165a56b7af::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit2be53ce21e2ba3efdf634ddb8f7bef9b::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit2be53ce21e2ba3efdf634ddb8f7bef9b::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit2be53ce21e2ba3efdf634ddb8f7bef9b::$classMap;

}, null, ClassLoader::class);
}
Expand Down
8 changes: 4 additions & 4 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php return array(
'root' => array(
'name' => 'merge-org/wp-plugin-merge-org-sort',
'pretty_version' => '2.4.0',
'version' => '2.4.0.0',
'pretty_version' => '2.4.1',
'version' => '2.4.1.0',
'reference' => null,
'type' => 'library',
'install_path' => __DIR__ . '/../../',
Expand All @@ -11,8 +11,8 @@
),
'versions' => array(
'merge-org/wp-plugin-merge-org-sort' => array(
'pretty_version' => '2.4.0',
'version' => '2.4.0.0',
'pretty_version' => '2.4.1',
'version' => '2.4.1.0',
'reference' => null,
'type' => 'library',
'install_path' => __DIR__ . '/../../',
Expand Down

0 comments on commit 6dc194d

Please sign in to comment.