Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Semaphore class name #900

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions includes/Settings/SettingsDebug.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,15 +245,15 @@ private function clear_tmp( $data ) {
}

private function clear_released_semaphore_locks( $data ) {
\WPO\WC\PDF_Invoices\Updraft_Semaphore_3_0::cleanup_released_locks();
\WPO\IPS\Semaphore::cleanup_released_locks();

$message = esc_html__( 'Released semaphore locks have been cleaned up!', 'woocommerce-pdf-invoices-packing-slips' );
wcpdf_log_error( $message, 'info' );
wp_send_json_success( compact( 'message' ) );
}

private function clear_released_legacy_semaphore_locks( $data ) {
\WPO\WC\PDF_Invoices\Updraft_Semaphore_3_0::cleanup_released_locks( true );
\WPO\IPS\Semaphore::cleanup_released_locks( true );

$message = esc_html__( 'Released legacy semaphore locks have been cleaned up!', 'woocommerce-pdf-invoices-packing-slips' );
wcpdf_log_error( $message, 'info' );
Expand Down
6 changes: 3 additions & 3 deletions views/advanced-tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<div class="notice inline" style="display:none;"><p></p></div>
</fieldset>
</form>
<?php $released_semaphore_locks = \WPO\WC\PDF_Invoices\Updraft_Semaphore_3_0::count_released_locks(); ?>
<?php $released_semaphore_locks = \WPO\IPS\Semaphore::count_released_locks(); ?>
<?php if ( $released_semaphore_locks > 0 ) : ?>
<div class="notice notice-warning inline">
<p>
Expand All @@ -91,7 +91,7 @@
<p><?php _e( 'There are no released semaphore locks in the database.', 'woocommerce-pdf-invoices-packing-slips' ); ?></p>
</div>
<?php endif; ?>
<?php $cleanup_action = \WPO\WC\PDF_Invoices\Updraft_Semaphore_3_0::get_cleanup_action(); ?>
<?php $cleanup_action = \WPO\IPS\Semaphore::get_cleanup_action(); ?>
<?php if ( $cleanup_action ) : ?>
<div class="notice notice-info inline">
<p>
Expand All @@ -113,7 +113,7 @@
<!-- /clear_released_semaphore_locks -->
<!-- clear_released_legacy_semaphore_locks -->
<?php
$released_legacy_semaphore_locks = \WPO\WC\PDF_Invoices\Updraft_Semaphore_3_0::count_released_locks( true );
$released_legacy_semaphore_locks = \WPO\IPS\Semaphore::count_released_locks( true );
if ( $released_legacy_semaphore_locks > 0 ) :
?>
<div class="tool">
Expand Down
2 changes: 1 addition & 1 deletion woocommerce-pdf-invoices-packingslips.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function __construct() {
add_action( 'admin_notices', array( $this, 'php_below_7_4_drop' ) );
add_action( 'admin_notices', array( $this, 'ubl_php_version_required' ) );
add_action( 'admin_notices', array( $this, 'legacy_addon_notices' ) );
add_action( 'init', array( '\\WPO\\WC\\PDF_Invoices\\Updraft_Semaphore_3_0', 'init_cleanup' ), 999 ); // wait AS to initialize
add_action( 'init', array( '\\WPO\\IPS\\Semaphore', 'init_cleanup' ), 999 ); // wait AS to initialize

// deactivate legacy extensions if activated
register_activation_hook( __FILE__, array( $this, 'deactivate_legacy_addons' ) );
Expand Down
16 changes: 8 additions & 8 deletions wpo-ips-legacy-class-alias-mapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
}

$wcpdf_legacy_class_alias_mapping = apply_filters( 'wpo_wcpdf_legacy_class_alias_mapping', array(

// includes/Compatibility
'\\WPO\\WC\\PDF_Invoices\\Compatibility\\Third_Party_Plugins' => '\\WPO\\IPS\\Compatibility\\ThirdPartyPlugins',
'\\WPO\\WC\\PDF_Invoices\\Compatibility\\Order_Util' => '\\WPO\\IPS\\Compatibility\\OrderUtil',

// includes/Documents
'\\WPO\\WC\\PDF_Invoices\\Documents\\Order_Document_Methods' => '\\WPO\\IPS\\Documents\\OrderDocumentMethods',
'\\WPO\\WC\\PDF_Invoices\\Documents\\Order_Document' => '\\WPO\\IPS\\Documents\\OrderDocument',
Expand All @@ -23,22 +23,22 @@
'\\WPO\\WC\\PDF_Invoices\\Documents\\Invoice' => '\\WPO\\IPS\\Documents\\Invoice',
'\\WPO\\WC\\PDF_Invoices\\Documents\\Packing_Slip' => '\\WPO\\IPS\\Documents\\PackingSlip',
'\\WPO\\WC\\PDF_Invoices\\Documents\\Sequential_Number_Store' => '\\WPO\\IPS\\Documents\\SequentialNumberStore',

// includes/Makers
'\\WPO\\WC\\PDF_Invoices\\Makers\\PDF_Maker' => '\\WPO\\IPS\\Makers\\PDFMaker',
'\\WPO\\WC\\PDF_Invoices\\Makers\\UBL_Maker' => '\\WPO\\IPS\\Makers\\UBLMaker',

// includes/Settings
'\\WPO\\WC\\PDF_Invoices\\Settings\\Settings_Callbacks' => '\\WPO\\IPS\\Settings\\SettingsCallbacks',
'\\WPO\\WC\\PDF_Invoices\\Settings\\Settings_Debug' => '\\WPO\\IPS\\Settings\\SettingsDebug',
'\\WPO\\WC\\PDF_Invoices\\Settings\\Settings_Documents' => '\\WPO\\IPS\\Settings\\SettingsDocuments',
'\\WPO\\WC\\PDF_Invoices\\Settings\\Settings_General' => '\\WPO\\IPS\\Settings\\SettingsGeneral',
'\\WPO\\WC\\PDF_Invoices\\Settings\\Settings_UBL' => '\\WPO\\IPS\\Settings\\SettingsUbl',
'\\WPO\\WC\\PDF_Invoices\\Settings\\Settings_Upgrade' => '\\WPO\\IPS\\Settings\\SettingsUpgrade',

// includes/Tables
'\\WPO\\WC\\PDF_Invoices\\Tables\\Number_Store_List_Table' => '\\WPO\\IPS\\Tables\\NumberStoreListTable',

// includes
'\\WPO\\WC\\PDF_Invoices\\Admin' => '\\WPO\\IPS\\Admin',
'\\WPO\\WC\\PDF_Invoices\\Assets' => '\\WPO\\IPS\\Assets',
Expand All @@ -51,10 +51,10 @@
'\\WPO\\WC\\PDF_Invoices\\Settings' => '\\WPO\\IPS\\Settings',
'\\WPO\\WC\\PDF_Invoices\\Setup_Wizard' => '\\WPO\\IPS\\SetupWizard',
'\\WPO\\WC\\PDF_Invoices\\Updraft_Semaphore_3_0' => '\\WPO\\IPS\\Semaphore',

// ubl
'\\WPO\\WC\\UBL\\Handlers\\UblHandler' => '\\WPO\\IPS\\UBL\\Handlers\\UblHandler', // used by `woocommerce-pdf-ips-ubl-extender`

) );

foreach ( $wcpdf_legacy_class_alias_mapping as $old_class => $new_class ) {
Expand Down
Loading