Merge branch 'master' into development/2.9.x

This commit is contained in:
Mykyta Synelnikov
2024-11-13 00:35:07 +02:00
5 changed files with 91 additions and 54 deletions
+4 -2
View File
@@ -26,9 +26,10 @@
/.github export-ignore /.github export-ignore
/assets/sass export-ignore /assets/sass export-ignore
/assets/libs/fontawesome/scss export-ignore /assets/libs/fontawesome/scss export-ignore
/docs export-ignore
/tests export-ignore
/blocks-src export-ignore /blocks-src export-ignore
/docs export-ignore
/node_modules export-ignore
/tests export-ignore
# Files # Files
/.bowerrc export-ignore /.bowerrc export-ignore
@@ -43,6 +44,7 @@
/hookdoc-conf.json export-ignore /hookdoc-conf.json export-ignore
/manifest.json export-ignore /manifest.json export-ignore
/package.json export-ignore /package.json export-ignore
/package-lock.json export-ignore
/phpcs.xml export-ignore /phpcs.xml export-ignore
/phpdoc.dist.xml export-ignore /phpdoc.dist.xml export-ignore
/README.md export-ignore /README.md export-ignore
-4
View File
@@ -45,14 +45,10 @@ jobs:
git rm bower.json git rm bower.json
git rm composer.json git rm composer.json
git rm gulpfile.js git rm gulpfile.js
git rm hookdoc-conf.json
git rm manifest.json git rm manifest.json
git rm package.json
git rm phpcs.xml git rm phpcs.xml
git rm phpdoc.dist.xml git rm phpdoc.dist.xml
git rm -r .github
git rm -r docs git rm -r docs
git rm -r blocks-src
git rm -r tests git rm -r tests
git add includes/lib/action-scheduler/\* git add includes/lib/action-scheduler/\*
git commit -a -m "Composer Installed. Cleared release repo." git commit -a -m "Composer Installed. Cleared release repo."
+9 -4
View File
@@ -45,7 +45,7 @@ if ( ! class_exists( 'um\action_scheduler\Init' ) ) {
UM()->admin()->notices()->add_notice( UM()->admin()->notices()->add_notice(
'um-action-scheduler', 'um-action-scheduler',
array( array(
'class' => 'notice-warning is-dismissible', 'class' => 'notice-warning is-dismissible',
// translators: %1$s - Plugin name, %1$s - Plugin Version // translators: %1$s - Plugin name, %1$s - Plugin Version
'message' => '<p>' . sprintf( __( '<strong>%1$s %2$s</strong> The file needed to enable the Action Scheduler is missing. The plugin will continue to function as it did before, but without the new benefits offered by the Action Scheduler.', 'ultimate-member' ), UM_PLUGIN_NAME, UM_VERSION ) . '</p>', 'message' => '<p>' . sprintf( __( '<strong>%1$s %2$s</strong> The file needed to enable the Action Scheduler is missing. The plugin will continue to function as it did before, but without the new benefits offered by the Action Scheduler.', 'ultimate-member' ), UM_PLUGIN_NAME, UM_VERSION ) . '</p>',
) )
@@ -55,6 +55,7 @@ if ( ! class_exists( 'um\action_scheduler\Init' ) ) {
if ( UM()->options()->get( 'enable_action_scheduler' ) ) { if ( UM()->options()->get( 'enable_action_scheduler' ) ) {
$this->enabled = true; $this->enabled = true;
$this->load_library( true );
} }
} }
} }
@@ -97,11 +98,15 @@ if ( ! class_exists( 'um\action_scheduler\Init' ) ) {
/** /**
* Tries to load Action Scheduler from Ultimate Member if file exists * Tries to load Action Scheduler from Ultimate Member if file exists
* *
* @param bool $force
*
* @return bool * @return bool
*/ */
public function load_library() { public function load_library( $force = false ) {
if ( file_exists( $this->lib_path ) ) { if ( file_exists( $this->lib_path ) ) {
require_once $this->lib_path; if ( $force ) {
require_once $this->lib_path;
}
return true; return true;
} }
@@ -148,7 +153,7 @@ if ( ! class_exists( 'um\action_scheduler\Init' ) ) {
* @param array $args Arguments to pass to callbacks when the hook triggers. Default: array() * @param array $args Arguments to pass to callbacks when the hook triggers. Default: array()
* @param string $group The group to assign this job to. Default: ''. * @param string $group The group to assign this job to. Default: ''.
* @param bool $unique Whether the action should be unique. Default: false. * @param bool $unique Whether the action should be unique. Default: false.
* @param int $priority Lower values take precedence over higher values. Defaults to 10, with acceptable values falling in the range 0-255.) * @param int $priority Lower values take precedence over higher values. Defaults to 10, with acceptable values falling in the range 0-255.
* *
* @return int The actions ID. Zero if there was an error scheduling the action. The error will be sent to error_log. * @return int The actions ID. Zero if there was an error scheduling the action. The error will be sent to error_log.
*/ */
+35 -5
View File
@@ -402,8 +402,22 @@ if ( ! class_exists( 'um\core\Files' ) ) {
wp_send_json_error( esc_js( __( 'This field doesn\'t support image crop', 'ultimate-member' ) ) ); wp_send_json_error( esc_js( __( 'This field doesn\'t support image crop', 'ultimate-member' ) ) );
} }
if ( 'profile' === $mode && ! um_can_edit_field( $custom_fields[ $key ] ) ) { if ( 'profile' === $mode ) {
wp_send_json_error( esc_js( __( 'You have no permission to edit this field', 'ultimate-member' ) ) ); if ( in_array( $key, array( 'cover_photo', 'profile_photo' ), true ) ) {
if ( 'profile_photo' === $key ) {
$disable_photo_uploader = empty( $post_data['use_custom_settings'] ) ? UM()->options()->get( 'disable_profile_photo_upload' ) : $post_data['disable_photo_upload'];
if ( $disable_photo_uploader ) {
wp_send_json_error( esc_js( __( 'You have no permission to edit this field', 'ultimate-member' ) ) );
}
} else {
$cover_enabled_uploader = empty( $post_data['use_custom_settings'] ) ? UM()->options()->get( 'profile_cover_enabled' ) : $post_data['cover_enabled'];
if ( ! $cover_enabled_uploader ) {
wp_send_json_error( esc_js( __( 'You have no permission to edit this field', 'ultimate-member' ) ) );
}
}
} elseif ( ! um_can_edit_field( $custom_fields[ $key ] ) ) {
wp_send_json_error( esc_js( __( 'You have no permission to edit this field', 'ultimate-member' ) ) );
}
} }
$src = esc_url_raw( $_REQUEST['src'] ); $src = esc_url_raw( $_REQUEST['src'] );
@@ -550,9 +564,25 @@ if ( ! class_exists( 'um\core\Files' ) ) {
} }
} }
if ( 'profile' === $mode && ! um_can_edit_field( $custom_fields[ $id ] ) ) { if ( 'profile' === $mode ) {
$ret['error'] = esc_html__( 'You have no permission to edit this field', 'ultimate-member' ); if ( in_array( $id, array( 'cover_photo', 'profile_photo' ), true ) ) {
wp_send_json_error( $ret ); if ( 'profile_photo' === $id ) {
$disable_photo_uploader = empty( $post_data['use_custom_settings'] ) ? UM()->options()->get( 'disable_profile_photo_upload' ) : $post_data['disable_photo_upload'];
if ( $disable_photo_uploader ) {
$ret['error'] = esc_html__( 'You have no permission to edit this field', 'ultimate-member' );
wp_send_json_error( $ret );
}
} else {
$cover_enabled_uploader = empty( $post_data['use_custom_settings'] ) ? UM()->options()->get( 'profile_cover_enabled' ) : $post_data['cover_enabled'];
if ( ! $cover_enabled_uploader ) {
$ret['error'] = esc_html__( 'You have no permission to edit this field', 'ultimate-member' );
wp_send_json_error( $ret );
}
}
} elseif ( ! um_can_edit_field( $custom_fields[ $id ] ) ) {
$ret['error'] = esc_html__( 'You have no permission to edit this field', 'ultimate-member' );
wp_send_json_error( $ret );
}
} }
if ( isset( $_FILES[ $id ]['name'] ) ) { if ( isset( $_FILES[ $id ]['name'] ) ) {
+43 -39
View File
@@ -9,7 +9,7 @@ msgstr ""
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2024-11-11T12:43:50+00:00\n" "POT-Creation-Date: 2024-11-12T20:23:40+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.11.0\n" "X-Generator: WP-CLI 2.11.0\n"
"X-Domain: ultimate-member\n" "X-Domain: ultimate-member\n"
@@ -40,15 +40,15 @@ msgstr ""
msgid "<strong>%1$s %2$s</strong> The file needed to enable the Action Scheduler is missing. The plugin will continue to function as it did before, but without the new benefits offered by the Action Scheduler." msgid "<strong>%1$s %2$s</strong> The file needed to enable the Action Scheduler is missing. The plugin will continue to function as it did before, but without the new benefits offered by the Action Scheduler."
msgstr "" msgstr ""
#: includes/action-scheduler/class-init.php:73 #: includes/action-scheduler/class-init.php:74
msgid "Action Scheduler" msgid "Action Scheduler"
msgstr "" msgstr ""
#: includes/action-scheduler/class-init.php:74 #: includes/action-scheduler/class-init.php:75
msgid "Enable Action Scheduler" msgid "Enable Action Scheduler"
msgstr "" msgstr ""
#: includes/action-scheduler/class-init.php:75 #: includes/action-scheduler/class-init.php:76
msgid "Check this box if you want to use the Ultimate Member action scheduler. By enabling it, certain tasks like sending system emails will be scheduled to run at optimal times, which can help reduce the load on your server" msgid "Check this box if you want to use the Ultimate Member action scheduler. By enabling it, certain tasks like sending system emails will be scheduled to run at optimal times, which can help reduce the load on your server"
msgstr "" msgstr ""
@@ -9446,10 +9446,10 @@ msgstr ""
#: includes/core/class-files.php:294 #: includes/core/class-files.php:294
#: includes/core/class-files.php:329 #: includes/core/class-files.php:329
#: includes/core/class-files.php:468 #: includes/core/class-files.php:482
#: includes/core/class-files.php:620 #: includes/core/class-files.php:650
#: includes/core/class-files.php:625 #: includes/core/class-files.php:655
#: includes/core/class-files.php:636 #: includes/core/class-files.php:666
msgid "You have no permission to edit this user" msgid "You have no permission to edit this user"
msgstr "" msgstr ""
@@ -9466,66 +9466,66 @@ msgid "Invalid coordinates"
msgstr "" msgstr ""
#: includes/core/class-files.php:333 #: includes/core/class-files.php:333
#: includes/core/class-files.php:473 #: includes/core/class-files.php:487
msgid "Please login to edit this user" msgid "Please login to edit this user"
msgstr "" msgstr ""
#: includes/core/class-files.php:343 #: includes/core/class-files.php:343
#: includes/core/class-files.php:484 #: includes/core/class-files.php:498
msgid "You have no permission to edit user profile" msgid "You have no permission to edit user profile"
msgstr "" msgstr ""
#: includes/core/class-files.php:347 #: includes/core/class-files.php:347
#: includes/core/class-files.php:489 #: includes/core/class-files.php:503
#: includes/core/class-files.php:641 #: includes/core/class-files.php:671
msgid "User has to be empty on registration" msgid "User has to be empty on registration"
msgstr "" msgstr ""
#: includes/core/class-files.php:353 #: includes/core/class-files.php:353
#: includes/core/class-files.php:496 #: includes/core/class-files.php:510
#: includes/core/class-files.php:648 #: includes/core/class-files.php:678
msgid "Invalid form ID" msgid "Invalid form ID"
msgstr "" msgstr ""
#: includes/core/class-files.php:357 #: includes/core/class-files.php:357
#: includes/core/class-files.php:501 #: includes/core/class-files.php:515
#: includes/core/class-files.php:653 #: includes/core/class-files.php:683
msgid "Invalid form post type" msgid "Invalid form post type"
msgstr "" msgstr ""
#: includes/core/class-files.php:362 #: includes/core/class-files.php:362
#: includes/core/class-files.php:507 #: includes/core/class-files.php:521
#: includes/core/class-files.php:659 #: includes/core/class-files.php:689
msgid "Invalid form status" msgid "Invalid form status"
msgstr "" msgstr ""
#: includes/core/class-files.php:367 #: includes/core/class-files.php:367
#: includes/core/class-files.php:513 #: includes/core/class-files.php:527
#: includes/core/class-files.php:665 #: includes/core/class-files.php:695
msgid "Invalid form type" msgid "Invalid form type"
msgstr "" msgstr ""
#: includes/core/class-files.php:376 #: includes/core/class-files.php:376
#: includes/core/class-files.php:381 #: includes/core/class-files.php:381
#: includes/core/class-files.php:384 #: includes/core/class-files.php:384
#: includes/core/class-files.php:523 #: includes/core/class-files.php:537
#: includes/core/class-files.php:529 #: includes/core/class-files.php:543
#: includes/core/class-files.php:533 #: includes/core/class-files.php:547
#: includes/core/class-files.php:675 #: includes/core/class-files.php:705
#: includes/core/class-files.php:681 #: includes/core/class-files.php:711
#: includes/core/class-files.php:685 #: includes/core/class-files.php:715
msgid "You have no permission to edit this user through this form" msgid "You have no permission to edit this user through this form"
msgstr "" msgstr ""
#: includes/core/class-files.php:391 #: includes/core/class-files.php:391
#: includes/core/class-files.php:541 #: includes/core/class-files.php:555
#: includes/core/class-files.php:693 #: includes/core/class-files.php:723
msgid "Invalid form fields" msgid "Invalid form fields"
msgstr "" msgstr ""
#: includes/core/class-files.php:397 #: includes/core/class-files.php:397
#: includes/core/class-files.php:548 #: includes/core/class-files.php:562
#: includes/core/class-files.php:699 #: includes/core/class-files.php:729
msgid "Invalid field metakey" msgid "Invalid field metakey"
msgstr "" msgstr ""
@@ -9533,27 +9533,31 @@ msgstr ""
msgid "This field doesn't support image crop" msgid "This field doesn't support image crop"
msgstr "" msgstr ""
#: includes/core/class-files.php:406 #: includes/core/class-files.php:410
#: includes/core/class-files.php:554 #: includes/core/class-files.php:415
#: includes/core/class-files.php:704 #: includes/core/class-files.php:419
#: includes/core/class-files.php:572
#: includes/core/class-files.php:578
#: includes/core/class-files.php:583
#: includes/core/class-files.php:734
msgid "You have no permission to edit this field" msgid "You have no permission to edit this field"
msgstr "" msgstr ""
#: includes/core/class-files.php:412 #: includes/core/class-files.php:426
msgid "Invalid file ownership" msgid "Invalid file ownership"
msgstr "" msgstr ""
#: includes/core/class-files.php:461 #: includes/core/class-files.php:475
#: includes/core/class-files.php:613 #: includes/core/class-files.php:643
msgid "Invalid nonce" msgid "Invalid nonce"
msgstr "" msgstr ""
#: includes/core/class-files.php:573 #: includes/core/class-files.php:603
#: includes/core/class-files.php:728 #: includes/core/class-files.php:758
msgid "A theme or plugin compatibility issue" msgid "A theme or plugin compatibility issue"
msgstr "" msgstr ""
#: includes/core/class-files.php:1501 #: includes/core/class-files.php:1531
msgid "Original size" msgid "Original size"
msgstr "" msgstr ""