Changeset 3169244
- Timestamp:
- 10/15/2024 12:13:22 PM (16 months ago)
- Location:
- publishpress-authors
- Files:
-
- 22 edited
- 1 copied
-
tags/4.7.2 (copied) (copied from publishpress-authors/trunk)
-
tags/4.7.2/defines.php (modified) (1 diff)
-
tags/4.7.2/languages/publishpress-authors.pot (modified) (32 diffs)
-
tags/4.7.2/publishpress-authors.php (modified) (1 diff)
-
tags/4.7.2/readme.txt (modified) (2 diffs)
-
tags/4.7.2/src/assets/js/coauthors-migration.min.js (modified) (1 diff)
-
tags/4.7.2/src/assets/js/settings.js (modified) (1 diff)
-
tags/4.7.2/src/core/Classes/Author_Editor.php (modified) (4 diffs)
-
tags/4.7.2/src/core/Classes/Objects/Author.php (modified) (4 diffs)
-
tags/4.7.2/src/core/Traits/Author_box.php (modified) (1 diff)
-
tags/4.7.2/src/modules/multiple-authors/assets/js/coauthors-migration.jsx (modified) (4 diffs)
-
tags/4.7.2/src/modules/multiple-authors/multiple-authors.php (modified) (1 diff)
-
trunk/defines.php (modified) (1 diff)
-
trunk/languages/publishpress-authors.pot (modified) (32 diffs)
-
trunk/publishpress-authors.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/src/assets/js/coauthors-migration.min.js (modified) (1 diff)
-
trunk/src/assets/js/settings.js (modified) (1 diff)
-
trunk/src/core/Classes/Author_Editor.php (modified) (4 diffs)
-
trunk/src/core/Classes/Objects/Author.php (modified) (4 diffs)
-
trunk/src/core/Traits/Author_box.php (modified) (1 diff)
-
trunk/src/modules/multiple-authors/assets/js/coauthors-migration.jsx (modified) (4 diffs)
-
trunk/src/modules/multiple-authors/multiple-authors.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
publishpress-authors/tags/4.7.2/defines.php
r3115415 r3169244 13 13 14 14 if (!defined('PP_AUTHORS_LOADED')) { 15 define('PP_AUTHORS_VERSION', '4.7. 1');15 define('PP_AUTHORS_VERSION', '4.7.2'); 16 16 define('PP_AUTHORS_FILE', 'publishpress-authors/publishpress-authors.php'); 17 17 define('PP_AUTHORS_BASE_PATH', plugin_dir_path(__DIR__ . '/publishpress-authors.php')); -
publishpress-authors/tags/4.7.2/languages/publishpress-authors.pot
r3115415 r3169244 3 3 msgstr "" 4 4 "Project-Id-Version: PublishPress Authors\n" 5 "POT-Creation-Date: 2024- 07-10 07:21+0000\n"5 "POT-Creation-Date: 2024-10-14 09:25+0000\n" 6 6 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 7 7 "Last-Translator: Anderson Grudtner Martins <[email protected]>\n" … … 521 521 msgstr "" 522 522 523 #: src/core/Classes/Author_Editor.php: 978523 #: src/core/Classes/Author_Editor.php:1007 524 524 msgid "An author email is required when creating new User Author." 525 525 msgstr "" 526 526 527 #: src/core/Classes/Author_Editor.php:9 48528 #: src/core/Classes/Author_Editor.php:9 66527 #: src/core/Classes/Author_Editor.php:977 528 #: src/core/Classes/Author_Editor.php:995 529 529 msgid "An author with the name provided already exists." 530 530 msgstr "" … … 819 819 msgstr "" 820 820 821 #: src/core/Classes/Author_Editor.php:7 30821 #: src/core/Classes/Author_Editor.php:759 822 822 msgid "Author Email" 823 823 msgstr "" … … 983 983 #: src/core/Authors_Widget.php:138 src/core/Plugin.php:856 984 984 #: src/core/Classes/Post_Editor.php:94 src/core/Classes/Post_Editor.php:206 985 #: src/core/Traits/Author_box.php:1 89985 #: src/core/Traits/Author_box.php:193 986 986 #: src/modules/author-categories/author-categories.php:624 987 987 #: src/modules/author-list/author-list.php:402 … … 1315 1315 msgstr "" 1316 1316 1317 #: src/modules/multiple-authors/multiple-authors.php:439 51317 #: src/modules/multiple-authors/multiple-authors.php:4393 1318 1318 msgid "Click to run the update now" 1319 1319 msgstr "" … … 1334 1334 #: src/modules/byline-migration/byline-migration.php:145 1335 1335 #: src/modules/bylines-migration/bylines-migration.php:147 1336 #: src/modules/multiple-authors/multiple-authors.php:38 611336 #: src/modules/multiple-authors/multiple-authors.php:3859 1337 1337 msgid "Collecting data for the migration..." 1338 1338 msgstr "" 1339 1339 1340 #: src/modules/multiple-authors/multiple-authors.php:379 31341 #: src/modules/multiple-authors/multiple-authors.php:382 41340 #: src/modules/multiple-authors/multiple-authors.php:3791 1341 #: src/modules/multiple-authors/multiple-authors.php:3822 1342 1342 msgid "Collecting data..." 1343 1343 msgstr "" … … 1370 1370 msgstr "" 1371 1371 1372 #: src/core/Classes/Author_Editor.php:8 091373 msgid "Convert into GuestAuthor With User Account"1372 #: src/core/Classes/Author_Editor.php:838 1373 msgid "Convert to Registered Author With User Account" 1374 1374 msgstr "" 1375 1375 … … 1397 1397 msgstr "" 1398 1398 1399 #: src/modules/multiple-authors/multiple-authors.php:386 61399 #: src/modules/multiple-authors/multiple-authors.php:3864 1400 1400 msgid "Copy Co-Authors Plus data" 1401 1401 msgstr "" … … 1412 1412 #: src/modules/byline-migration/byline-migration.php:149 1413 1413 #: src/modules/bylines-migration/bylines-migration.php:151 1414 #: src/modules/multiple-authors/multiple-authors.php:386 51414 #: src/modules/multiple-authors/multiple-authors.php:3863 1415 1415 msgid "Copying authors' data..." 1416 1416 msgstr "" 1417 1417 1418 #: src/core/Classes/Author_Editor.php:7 041418 #: src/core/Classes/Author_Editor.php:733 1419 1419 msgid "" 1420 1420 "Create an author profile and a linked user account. This account will be in " … … 1423 1423 msgstr "" 1424 1424 1425 #: src/core/Classes/Author_Editor.php: 6981425 #: src/core/Classes/Author_Editor.php:727 1426 1426 msgid "" 1427 1427 "Create an author profile for a current user account. You can select users " … … 1430 1430 msgstr "" 1431 1431 1432 #: src/core/Classes/Author_Editor.php:7 111432 #: src/core/Classes/Author_Editor.php:740 1433 1433 msgid "" 1434 1434 "Create an author profile with no linked user account. This option is " … … 1474 1474 msgstr "" 1475 1475 1476 #: src/modules/multiple-authors/multiple-authors.php:386 31476 #: src/modules/multiple-authors/multiple-authors.php:3861 1477 1477 msgid "Creating missed post authors...." 1478 1478 msgstr "" … … 1548 1548 msgstr "" 1549 1549 1550 #: src/modules/multiple-authors/multiple-authors.php:386 91550 #: src/modules/multiple-authors/multiple-authors.php:3867 1551 1551 msgid "Deactivate Co-Authors Plus" 1552 1552 msgstr "" … … 1560 1560 msgstr "" 1561 1561 1562 #: src/modules/multiple-authors/multiple-authors.php:386 71562 #: src/modules/multiple-authors/multiple-authors.php:3865 1563 1563 msgid "Deactivating Co-uthors Plus..." 1564 1564 msgstr "" … … 1695 1695 msgstr "" 1696 1696 1697 #: src/modules/multiple-authors/multiple-authors.php:432 71698 #: src/modules/multiple-authors/multiple-authors.php:4 4011697 #: src/modules/multiple-authors/multiple-authors.php:4325 1698 #: src/modules/multiple-authors/multiple-authors.php:4399 1699 1699 msgid "Dismiss" 1700 1700 msgstr "" … … 1791 1791 msgstr "" 1792 1792 1793 #: src/modules/multiple-authors/multiple-authors.php:382 61793 #: src/modules/multiple-authors/multiple-authors.php:3824 1794 1794 msgid "Done! %d authors were updated." 1795 1795 msgstr "" 1796 1796 1797 #: src/modules/multiple-authors/multiple-authors.php:379 51797 #: src/modules/multiple-authors/multiple-authors.php:3793 1798 1798 msgid "Done! %d posts were updated." 1799 1799 msgstr "" … … 1815 1815 msgstr "" 1816 1816 1817 #: src/modules/multiple-authors/multiple-authors.php:38 701817 #: src/modules/multiple-authors/multiple-authors.php:3868 1818 1818 msgid "Done! Co-Authors Plus data was copied." 1819 1819 msgstr "" 1820 1820 1821 #: src/modules/multiple-authors/multiple-authors.php:386 81821 #: src/modules/multiple-authors/multiple-authors.php:3866 1822 1822 msgid "Done! Co-Authors Plus is deactivated." 1823 1823 msgstr "" … … 2002 2002 #: src/modules/byline-migration/byline-migration.php:146 2003 2003 #: src/modules/bylines-migration/bylines-migration.php:148 2004 #: src/modules/multiple-authors/multiple-authors.php:386 22004 #: src/modules/multiple-authors/multiple-authors.php:3860 2005 2005 msgid "Error: " 2006 2006 msgstr "" … … 2104 2104 msgstr "" 2105 2105 2106 #: src/modules/multiple-authors/multiple-authors.php:379 42107 #: src/modules/multiple-authors/multiple-authors.php:382 52106 #: src/modules/multiple-authors/multiple-authors.php:3792 2107 #: src/modules/multiple-authors/multiple-authors.php:3823 2108 2108 msgid "Finishing the process..." 2109 2109 msgstr "" … … 2188 2188 msgstr "" 2189 2189 2190 #: src/modules/multiple-authors/multiple-authors.php:478 62190 #: src/modules/multiple-authors/multiple-authors.php:4784 2191 2191 msgid "Guest Author cannot login on the site." 2192 2192 msgstr "" 2193 2193 2194 2194 #: src/core/Classes/Author_Editor.php:121 2195 #: src/core/Classes/Author_Editor.php:7 102195 #: src/core/Classes/Author_Editor.php:739 2196 2196 #: src/modules/author-list/author-list.php:979 2197 2197 msgid "Guest Author With No User Account" … … 2199 2199 2200 2200 #: src/core/Classes/Author_Editor.php:117 2201 #: src/core/Classes/Author_Editor.php:7 032201 #: src/core/Classes/Author_Editor.php:732 2202 2202 #: src/modules/author-list/author-list.php:978 2203 2203 msgid "Guest Author With User Account" … … 2425 2425 msgstr "" 2426 2426 2427 #: src/modules/multiple-authors/multiple-authors.php:43 212427 #: src/modules/multiple-authors/multiple-authors.php:4319 2428 2428 msgid "It looks like you have Co-Authors Plus installed." 2429 2429 msgstr "" … … 2555 2555 msgstr "" 2556 2556 2557 #: src/core/Classes/Admin_Ajax.php:346 src/core/Classes/Author_Editor.php:10 142557 #: src/core/Classes/Admin_Ajax.php:346 src/core/Classes/Author_Editor.php:1043 2558 2558 msgid "Mapped user is required." 2559 2559 msgstr "" … … 2661 2661 msgstr "" 2662 2662 2663 #: src/core/Classes/Author_Editor.php: 8782663 #: src/core/Classes/Author_Editor.php:907 2664 2664 msgid "No authors were updated" 2665 2665 msgstr "" … … 2825 2825 msgstr "" 2826 2826 2827 #: src/modules/multiple-authors/multiple-authors.php:432 22827 #: src/modules/multiple-authors/multiple-authors.php:4320 2828 2828 msgid "Please click here and read this guide!" 2829 2829 msgstr "" … … 2844 2844 #: src/modules/byline-migration/byline-migration.php:148 2845 2845 #: src/modules/bylines-migration/bylines-migration.php:150 2846 #: src/modules/multiple-authors/multiple-authors.php:379 62847 #: src/modules/multiple-authors/multiple-authors.php:382 72848 #: src/modules/multiple-authors/multiple-authors.php:386 42846 #: src/modules/multiple-authors/multiple-authors.php:3794 2847 #: src/modules/multiple-authors/multiple-authors.php:3825 2848 #: src/modules/multiple-authors/multiple-authors.php:3862 2849 2849 msgid "Please, wait..." 2850 2850 msgstr "" … … 2959 2959 msgstr "" 2960 2960 2961 #: src/modules/multiple-authors/multiple-authors.php:439 42961 #: src/modules/multiple-authors/multiple-authors.php:4392 2962 2962 msgid "" 2963 2963 "PublishPress Authors needs a database update for Permissions integration." … … 3086 3086 3087 3087 #: src/core/Classes/Author_Editor.php:119 3088 #: src/core/Classes/Author_Editor.php: 6973088 #: src/core/Classes/Author_Editor.php:726 3089 3089 #: src/modules/author-list/author-list.php:977 3090 3090 msgid "Registered Author With User Account" … … 3292 3292 msgstr "" 3293 3293 3294 #: src/core/Classes/Author_Editor.php:7 423294 #: src/core/Classes/Author_Editor.php:771 3295 3295 msgid "Select Author Account" 3296 3296 msgstr "" … … 3548 3548 msgstr "" 3549 3549 3550 #: src/core/Classes/Admin_Ajax.php:334 src/core/Classes/Author_Editor.php:9 223550 #: src/core/Classes/Admin_Ajax.php:334 src/core/Classes/Author_Editor.php:951 3551 3551 msgid "" 3552 3552 "Sorry, this WordPress user is already mapped to another Author. By default, " … … 3576 3576 msgstr "" 3577 3577 3578 #: src/core/Classes/Author_Editor.php:8 053579 #: src/modules/multiple-authors/multiple-authors.php:379 23578 #: src/core/Classes/Author_Editor.php:834 3579 #: src/modules/multiple-authors/multiple-authors.php:3790 3580 3580 msgid "Sync author and user fields" 3581 3581 msgstr "" 3582 3582 3583 #: src/modules/multiple-authors/multiple-authors.php:382 33583 #: src/modules/multiple-authors/multiple-authors.php:3821 3584 3584 msgid "Sync author and user URLs" 3585 3585 msgstr "" … … 3863 3863 msgstr "" 3864 3864 3865 #: src/core/Classes/Author_Editor.php:8 133865 #: src/core/Classes/Author_Editor.php:842 3866 3866 msgid "Update post count" 3867 3867 msgstr "" 3868 3868 3869 #: src/core/Classes/Author_Editor.php: 8813869 #: src/core/Classes/Author_Editor.php:910 3870 3870 msgid "Updated %d authors" 3871 3871 msgstr "" 3872 3872 3873 #: src/modules/multiple-authors/multiple-authors.php:382 93873 #: src/modules/multiple-authors/multiple-authors.php:3827 3874 3874 msgid "Updated %d of %d authors..." 3875 3875 msgstr "" 3876 3876 3877 #: src/modules/multiple-authors/multiple-authors.php:379 83877 #: src/modules/multiple-authors/multiple-authors.php:3796 3878 3878 msgid "Updated %d of %d posts..." 3879 3879 msgstr "" 3880 3880 3881 #: src/modules/multiple-authors/multiple-authors.php:379 73881 #: src/modules/multiple-authors/multiple-authors.php:3795 3882 3882 msgid "Updating author field on posts..." 3883 3883 msgstr "" 3884 3884 3885 #: src/modules/multiple-authors/multiple-authors.php:382 83885 #: src/modules/multiple-authors/multiple-authors.php:3826 3886 3886 msgid "Updating authors slug..." 3887 3887 msgstr "" -
publishpress-authors/tags/4.7.2/publishpress-authors.php
r3115415 r3169244 6 6 * Author: PublishPress 7 7 * Author URI: https://publishpress.com 8 * Version: 4.7. 18 * Version: 4.7.2 9 9 * Text Domain: publishpress-authors 10 10 * Domain Path: /languages -
publishpress-authors/tags/4.7.2/readme.txt
r3115415 r3169244 7 7 Requires at least: 5.5 8 8 Requires PHP: 7.2.5 9 Tested up to: 6. 510 Stable tag: 4.7. 19 Tested up to: 6.6 10 Stable tag: 4.7.2 11 11 License: GPLv2 or later 12 12 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 246 246 247 247 == Changelog == 248 249 = [4.7.2] - 15 Oct 2024 = 250 251 * Update: Improve Author User data update capability check 252 * Fixed: Fix Guest Author conversion not working for Author without email, #1908 253 * Update: Brazil Translation Update, #1910 248 254 249 255 = [4.7.1] - 10 July 2024 = -
publishpress-authors/tags/4.7.2/src/assets/js/coauthors-migration.min.js
r3096813 r3169244 1 !function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=13)}([function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}},function(t,e,r){var n=r(6),o=r(0);t.exports=function(t,e){return!e||"object"!==n(e)&&"function"!=typeof e?o(t):e}},function(t,e){function r(e){return t.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},r(e)}t.exports=r},function(t,e,r){var n=r(7);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&n(t,e)}},function(t,e){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=r=function(t){return typeof t}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(e)}t.exports=r},function(t,e){function r(e,n){return t.exports=r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(e,n)}t.exports=r},,,,,,function(t,e,r){"use strict";r.r(e);var n=r(1),o=r.n(n),a=r(2),i=r.n(a),s=r(3),u=r.n(s),c=r(4),l=r.n(c),p=r(0),g=r.n(p), h=r(5),f=r.n(h),d=function(t){function e(t){var r;return o()(this,e),(r=u()(this,l()(e).call(this,t))).renderDeactivatePluginOption=r.renderDeactivatePluginOption.bind(g()(r)),r.renderProgressBar=r.renderProgressBar.bind(g()(r)),r.renderLog=r.renderLog.bind(g()(r)),r.deactivateCoAuthorsPlus=r.deactivateCoAuthorsPlus.bind(g()(r)),r.startMigration=r.startMigration.bind(g()(r)),r.clickStart=r.clickStart.bind(g()(r)),r.reset=r.reset.bind(g()(r)),r.migrateChunkOfData=r.migrateChunkOfData.bind(g()(r)),r.getCoAuthorsMigrationInitialData=r.getCoAuthorsMigrationInitialData.bind(g()(r)),r.state={totalToMigrate:0,totalMigrated:0,inProgress:!1,chunkSize:r.props.chunkSize,progress:0,log:"",showDeactivateOption:!1,disablingCoAuthors:!1},r}return f()(e,t),i()(e,[{key:"clickStart",value:function(t){t.preventDefault(),this.startMigration()}},{key:"getCoAuthorsMigrationInitialData",value:function(t){var e=this;this.setState({log:ppmaCoAuthorsMigration.start_message}),window.setTimeout((function(){jQuery.ajax({type:"GET",dataType:"json",url:ajaxurl,async:!1,data:{action:"get_coauthors_migration_data",nonce:this.props.nonce},success:function(r){e.setState({totalToMigrate:r.total}),t()},error:function(t,r,n){e.setState({progress:0,inProgress:!1,log:ppmaCoAuthorsMigration.error_message+n+" ["+r+"]",showDeactivateOption:!1})}})}),1e3)}},{key:"finishCoAuthorsMigration",value:function(t){this.setState({progress:99,log:ppmaCoAuthorsMigration.progress_message}),window.setTimeout((function(){jQuery.ajax({type:"GET",dataType:"json",url:ajaxurl,async:!1,data:{action:"finish_coauthors_migration",nonce:this.props.nonce},success:function(){t()},error:function(t,e,r){this.setState({progress:0,inProgress:!1,log:ppmaCoAuthorsMigration.error_message+r+" ["+e+"]",showDeactivateOption:!1})}})}),1e3)}},{key:"migrateChunkOfData",value:function(){var t=this;jQuery.ajax({type:"GET",dataType:"json",url:ajaxurl,data:{action:"migrate_coauthors",nonce:this.props.nonce,chunkSize:this.state.chunkSize},success:function(){var e=t.state.totalMigrated+t.state.chunkSize;e>t.state.totalToMigrate&&(e=t.state.totalToMigrate),t.setState({totalMigrated:e,progress:2+Math.floor(98/t.state.totalToMigrate*e)}),e<t.state.totalToMigrate?t.migrateChunkOfData():t.finishCoAuthorsMigration((function(){t.setState({progress:100,log:ppmaCoAuthorsMigration.completed_message,showDeactivateOption:!0}),window.setTimeout((function(){t.setState({inProgress:!1})}),1e3)}))},error:function(e,r,n){t.setState({progress:0,inProgress:!1,log:ppmaCoAuthorsMigration.error_message+n+" ["+r+"]",showDeactivateOption:!1})}})}},{key:"startMigration",value:function(){var t=this;this.setState({progress:1,inProgress:!0,log:ppmaCoAuthorsMigration.wait_message,showDeactivateOption:!1}),window.setTimeout((function(){t.getCoAuthorsMigrationInitialData((function(){t.setState({progress:2,log:ppmaCoAuthorsMigration.copying_message}),t.migrateChunkOfData()}))}),1e3)}},{key:"deactivateCoAuthorsPlus",value:function(){var t=this;this.setState({disablingCoAuthors:!0,log:ppmaCoAuthorsMigration.deactivating_message}),jQuery.ajax({type:"GET",dataType:"json",url:ajaxurl,data:{action:"deactivate_coauthors_plus",nonce:this.props.nonce},success:function(){t.setState({disablingCoAuthors:!1,log:ppmaCoAuthorsMigration.deactivated_message,showDeactivateOption:!1})},error:function(e,r,n){t.setState({disablingCoAuthors:!1,log:ppmaCoAuthorsMigration.error_message+n+" ["+r+"]"})}})}},{key:"renderDeactivatePluginOption",value:function(){var t=ppmaCoAuthorsMigration.deactivate_message,e=!this.state.disablingCoAuthors;return wp.element.createElement(m,{label:t,onClick:this.deactivateCoAuthorsPlus,enabled:e})}},{key:"reset",value:function(){this.setState({progress:0,inProgress:!1})}},{key:"renderProgressBar",value:function(){return wp.element.createElement(y,{value:this.state.progress})}},{key:"renderLog",value:function(){return wp.element.createElement(v,{log:this.state.log,show:this.state.showDeactivateOption})}},{key:"render",value:function(){var t=!this.state.inProgress,e=this.state.inProgress?this.renderProgressBar():"",r=""==this.state.log?"":this.renderLog(),n=this.state.showDeactivateOption?this.renderDeactivatePluginOption():"";return wp.element.createElement("div",null,wp.element.createElement(m,{label:ppmaCoAuthorsMigration.copy_message,onClick:this.startMigration,enabled:t}),n,e,r)}}]),e}(React.Component),m=function(t){function e(t){return o()(this,e),u()(this,l()(e).call(this,t))}return f()(e,t),i()(e,[{key:"render",value:function(){var t=!this.props.enabled;return wp.element.createElement("input",{type:"button",className:"button button-secondary button-danger ppma_maintenance_button",onClick:this.props.onClick,disabled:t,value:this.props.label})}}]),e}(React.Component),v=function(t){function e(t){return o()(this,e),u()(this,l()(e).call(this,t))}return f()(e,t),i()(e,[{key:"render",value:function(){return wp.element.createElement("div",null,wp.element.createElement("div",{class:"ppma_maintenance_log",readOnly:!0},this.props.log))}}]),e}(React.Component),y=function(t){function e(t){return o()(this,e),u()(this,l()(e).call(this,t))}return f()(e,t),i()(e,[{key:"renderLabel",value:function(){return wp.element.createElement("div",{className:"p-progressbar-label"},this.props.value," %")}},{key:"render",value:function(){var t=this.renderLabel();return wp.element.createElement("div",{role:"progressbar",id:this.props.id,className:"p-progressbar p-component p-progressbar-determinate",style:this.props.style,"aria-valuemin":"0","aria-valuenow":this.props.value,"aria-valuemax":"100","aria-label":this.props.value},wp.element.createElement("div",{className:"p-progressbar-value p-progressbar-value-animate",style:{width:this.props.value+"%",display:"block"}}),t)}}]),e}(React.Component);jQuery((function(){ReactDOM.render(wp.element.createElement(d,{notMigratedPostsId:ppmaCoAuthorsMigration.notMigratedPostsId,nonce:ppmaCoAuthorsMigration.nonce,chunkSize:5}),document.getElementById("publishpress-authors-coauthors-migration"))}))}]);1 !function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=13)}([function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}},function(t,e,r){var n=r(6),o=r(0);t.exports=function(t,e){return!e||"object"!==n(e)&&"function"!=typeof e?o(t):e}},function(t,e){function r(e){return t.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},r(e)}t.exports=r},function(t,e,r){var n=r(7);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&n(t,e)}},function(t,e){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=r=function(t){return typeof t}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(e)}t.exports=r},function(t,e){function r(e,n){return t.exports=r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(e,n)}t.exports=r},,,,,,function(t,e,r){"use strict";r.r(e);var n=r(1),o=r.n(n),a=r(2),i=r.n(a),s=r(3),u=r.n(s),c=r(4),l=r.n(c),p=r(0),g=r.n(p),f=r(5),h=r.n(f),d=function(t){function e(t){var r;return o()(this,e),(r=u()(this,l()(e).call(this,t))).renderDeactivatePluginOption=r.renderDeactivatePluginOption.bind(g()(r)),r.renderProgressBar=r.renderProgressBar.bind(g()(r)),r.renderLog=r.renderLog.bind(g()(r)),r.deactivateCoAuthorsPlus=r.deactivateCoAuthorsPlus.bind(g()(r)),r.startMigration=r.startMigration.bind(g()(r)),r.clickStart=r.clickStart.bind(g()(r)),r.reset=r.reset.bind(g()(r)),r.migrateChunkOfData=r.migrateChunkOfData.bind(g()(r)),r.getCoAuthorsMigrationInitialData=r.getCoAuthorsMigrationInitialData.bind(g()(r)),r.state={totalToMigrate:0,totalMigrated:0,inProgress:!1,chunkSize:r.props.chunkSize,progress:0,log:"",showDeactivateOption:!1,disablingCoAuthors:!1},r}return h()(e,t),i()(e,[{key:"clickStart",value:function(t){t.preventDefault(),this.startMigration()}},{key:"getCoAuthorsMigrationInitialData",value:function(t){var e=this;this.setState({log:ppmaCoAuthorsMigration.start_message}),window.setTimeout((function(){jQuery.ajax({type:"GET",dataType:"json",url:ajaxurl,async:!1,data:{action:"get_coauthors_migration_data",nonce:e.props.nonce},success:function(r){e.setState({totalToMigrate:r.total}),t()},error:function(t,r,n){e.setState({progress:0,inProgress:!1,log:ppmaCoAuthorsMigration.error_message+n+" ["+r+"]",showDeactivateOption:!1})}})}),1e3)}},{key:"finishCoAuthorsMigration",value:function(t){var e=this;this.setState({progress:99,log:ppmaCoAuthorsMigration.progress_message}),window.setTimeout((function(){jQuery.ajax({type:"GET",dataType:"json",url:ajaxurl,async:!1,data:{action:"finish_coauthors_migration",nonce:e.props.nonce},success:function(){t()},error:function(t,r,n){e.setState({progress:0,inProgress:!1,log:ppmaCoAuthorsMigration.error_message+n+" ["+r+"]",showDeactivateOption:!1})}})}),1e3)}},{key:"migrateChunkOfData",value:function(){var t=this;jQuery.ajax({type:"GET",dataType:"json",url:ajaxurl,data:{action:"migrate_coauthors",nonce:t.props.nonce,chunkSize:t.state.chunkSize},success:function(){var e=t.state.totalMigrated+t.state.chunkSize;e>t.state.totalToMigrate&&(e=t.state.totalToMigrate),t.setState({totalMigrated:e,progress:2+Math.floor(98/t.state.totalToMigrate*e)}),e<t.state.totalToMigrate?t.migrateChunkOfData():t.finishCoAuthorsMigration((function(){t.setState({progress:100,log:ppmaCoAuthorsMigration.completed_message,showDeactivateOption:!0}),window.setTimeout((function(){t.setState({inProgress:!1})}),1e3)}))},error:function(e,r,n){t.setState({progress:0,inProgress:!1,log:ppmaCoAuthorsMigration.error_message+n+" ["+r+"]",showDeactivateOption:!1})}})}},{key:"startMigration",value:function(){var t=this;this.setState({progress:1,inProgress:!0,log:ppmaCoAuthorsMigration.wait_message,showDeactivateOption:!1}),window.setTimeout((function(){t.getCoAuthorsMigrationInitialData((function(){t.setState({progress:2,log:ppmaCoAuthorsMigration.copying_message}),t.migrateChunkOfData()}))}),1e3)}},{key:"deactivateCoAuthorsPlus",value:function(){var t=this;this.setState({disablingCoAuthors:!0,log:ppmaCoAuthorsMigration.deactivating_message}),jQuery.ajax({type:"GET",dataType:"json",url:ajaxurl,data:{action:"deactivate_coauthors_plus",nonce:t.props.nonce},success:function(){t.setState({disablingCoAuthors:!1,log:ppmaCoAuthorsMigration.deactivated_message,showDeactivateOption:!1})},error:function(e,r,n){t.setState({disablingCoAuthors:!1,log:ppmaCoAuthorsMigration.error_message+n+" ["+r+"]"})}})}},{key:"renderDeactivatePluginOption",value:function(){var t=ppmaCoAuthorsMigration.deactivate_message,e=!this.state.disablingCoAuthors;return wp.element.createElement(m,{label:t,onClick:this.deactivateCoAuthorsPlus,enabled:e})}},{key:"reset",value:function(){this.setState({progress:0,inProgress:!1})}},{key:"renderProgressBar",value:function(){return wp.element.createElement(y,{value:this.state.progress})}},{key:"renderLog",value:function(){return wp.element.createElement(v,{log:this.state.log,show:this.state.showDeactivateOption})}},{key:"render",value:function(){var t=!this.state.inProgress,e=this.state.inProgress?this.renderProgressBar():"",r=""==this.state.log?"":this.renderLog(),n=this.state.showDeactivateOption?this.renderDeactivatePluginOption():"";return wp.element.createElement("div",null,wp.element.createElement(m,{label:ppmaCoAuthorsMigration.copy_message,onClick:this.startMigration,enabled:t}),n,e,r)}}]),e}(React.Component),m=function(t){function e(t){return o()(this,e),u()(this,l()(e).call(this,t))}return h()(e,t),i()(e,[{key:"render",value:function(){var t=!this.props.enabled;return wp.element.createElement("input",{type:"button",className:"button button-secondary button-danger ppma_maintenance_button",onClick:this.props.onClick,disabled:t,value:this.props.label})}}]),e}(React.Component),v=function(t){function e(t){return o()(this,e),u()(this,l()(e).call(this,t))}return h()(e,t),i()(e,[{key:"render",value:function(){return wp.element.createElement("div",null,wp.element.createElement("div",{class:"ppma_maintenance_log",readOnly:!0},this.props.log))}}]),e}(React.Component),y=function(t){function e(t){return o()(this,e),u()(this,l()(e).call(this,t))}return h()(e,t),i()(e,[{key:"renderLabel",value:function(){return wp.element.createElement("div",{className:"p-progressbar-label"},this.props.value," %")}},{key:"render",value:function(){var t=this.renderLabel();return wp.element.createElement("div",{role:"progressbar",id:this.props.id,className:"p-progressbar p-component p-progressbar-determinate",style:this.props.style,"aria-valuemin":"0","aria-valuenow":this.props.value,"aria-valuemax":"100","aria-label":this.props.value},wp.element.createElement("div",{className:"p-progressbar-value p-progressbar-value-animate",style:{width:this.props.value+"%",display:"block"}}),t)}}]),e}(React.Component);jQuery((function(){ReactDOM.render(wp.element.createElement(d,{notMigratedPostsId:ppmaCoAuthorsMigration.notMigratedPostsId,nonce:ppmaCoAuthorsMigration.nonce,chunkSize:5}),document.getElementById("publishpress-authors-coauthors-migration"))}))}]); -
publishpress-authors/tags/4.7.2/src/assets/js/settings.js
r3105206 r3169244 25 25 var ppmaTab = 'ppma-tab-general'; 26 26 27 if (typeof ppmaSettings != 'undefined' && typeof ppmaSettings.tab != 'undefined' ) {27 if (typeof ppmaSettings != 'undefined' && typeof ppmaSettings.tab != 'undefined' && ppmaSettings.tab !== '') { 28 28 ppmaTab = ppmaSettings.tab; 29 29 $('#publishpress-authors-settings-tabs a[href="#' + ppmaTab + '"]').click(); -
publishpress-authors/tags/4.7.2/src/core/Classes/Author_Editor.php
r3115415 r3169244 583 583 { 584 584 if (empty($_POST['author-edit-nonce']) 585 || !is_user_logged_in() 585 586 || !wp_verify_nonce(sanitize_key($_POST['author-edit-nonce']), 'author-edit')) { 586 587 return; … … 597 598 $user = false; 598 599 $user_id = false; 599 } else { 600 $updated_args['ID'] = $user_id; 601 } 600 } 601 } 602 603 /** 604 * Make sure current user is set as user ID if user does not 605 * have capability to edit other authors/users. 606 * 607 * Note: Prevent ability to edit administrator completely. 608 */ 609 if ($user && (int)$user_id !== get_current_user_id()) { 610 611 // Prevent editing administrators completely 612 if (in_array('administrator', $user->roles)) { 613 $user_id = false; 614 $user = false; 615 } 616 // Check if the user lacks the necessary capabilities and fallback to current user 617 elseif (!current_user_can(get_taxonomy('author')->cap->manage_terms) 618 || !current_user_can('edit_user', $user_id)) { 619 // Fallback to current user if they lack permissions 620 $user_id = get_current_user_id(); 621 $user = get_user_by('id', $user_id); 622 } 623 } 624 625 if ($user) { 626 $updated_args['ID'] = $user_id; 602 627 } 603 628 … … 607 632 } 608 633 $sanitize = isset($args['sanitize']) ? $args['sanitize'] : 'sanitize_text_field'; 609 $field_value = $sanitize($_POST['authors-' . $key]); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized 634 if ($key == 'user_id') { 635 $field_value = $user_id; 636 } else { 637 $field_value = $sanitize($_POST['authors-' . $key]); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized 638 } 610 639 update_term_meta($term_id, $key, $field_value); 611 640 if ($user_id) { … … 808 837 ); 809 838 $bulk_actions['convert_into_guest_author'] = __( 810 'Convert into GuestAuthor With User Account',839 'Convert to Registered Author With User Account', 811 840 'publishpress-authors' 812 841 ); -
publishpress-authors/tags/4.7.2/src/core/Classes/Objects/Author.php
r3115415 r3169244 342 342 $userId = get_term_meta($term_id, 'user_id', true); 343 343 $author = Author::get_by_term_id($term_id); 344 345 $new_author_email = !empty($author->user_email) ? $author->user_email : self::generate_random_domain_email($term_id); 346 344 347 if ($userId && is_object($author) && isset($author->display_name)) { 345 348 $user_data = [ … … 350 353 update_term_meta($term_id, 'user_id', $userId); 351 354 update_term_meta($term_id, 'user_id_' . $userId, $userId); 352 } else if (!empty($author->user_email)){355 } else { 353 356 $user_data = [ 354 'user_login' => !empty($author->user_login)? $author->user_login : sanitize_title($ author->user_email),357 'user_login' => !empty($author->user_login)? $author->user_login : sanitize_title($new_author_email), 355 358 'display_name' => $author->display_name, 356 'user_email' => $ author->user_email,359 'user_email' => $new_author_email, 357 360 'user_pass' => wp_generate_password(), 358 361 'role' => 'ppma_guest_author', 359 362 ]; 360 363 $userId = wp_insert_user($user_data); 361 364 362 365 if (!is_wp_error($userId)) { 366 update_term_meta($term_id, 'user_email', $new_author_email); 363 367 update_term_meta($term_id, 'user_id', $userId); 364 368 update_term_meta($term_id, 'user_id_' . $userId, $userId); 365 369 } 366 } else { 367 delete_term_meta($term_id, 'user_id'); 368 delete_term_meta($term_id, 'user_id_' . $userId); 369 } 370 } 371 } 372 373 /** 374 * Generate random domain email 375 */ 376 public static function generate_random_domain_email($unique_id = '') { 377 // Get current timestamp 378 $timestamp = $unique_id . time(); 379 380 // Get website domain 381 $domain = parse_url(get_bloginfo('url'), PHP_URL_HOST); 382 383 // Generate the email 384 $random_email = 'guestauthor+' . $timestamp . '@' . $domain; 385 386 return $random_email; 370 387 } 371 388 … … 747 764 $urls = $this->get_custom_avatar_url($size); 748 765 766 $imageId = attachment_url_to_postid($urls['url']); 767 749 768 $class = [ 750 769 'multiple_authors_guest_author_avatar', … … 752 771 ]; 753 772 754 $alt = $this->display_name;773 $alt = get_post_meta( $imageId, '_wp_attachment_image_alt', true ); 755 774 756 775 // Build the HTML tag. -
publishpress-authors/tags/4.7.2/src/core/Traits/Author_box.php
r3087197 r3169244 176 176 } 177 177 } 178 } 179 180 if (empty($authorsList)) { 181 return ''; 178 182 } 179 183 -
publishpress-authors/tags/4.7.2/src/modules/multiple-authors/assets/js/coauthors-migration.jsx
r3096813 r3169244 46 46 data: { 47 47 action: 'get_coauthors_migration_data', 48 nonce: this.props.nonce48 nonce: self.props.nonce 49 49 }, 50 50 success: function (response) { … … 83 83 data: { 84 84 action: 'finish_coauthors_migration', 85 nonce: this.props.nonce85 nonce: self.props.nonce 86 86 }, 87 87 success: function (response) { … … 109 109 data: { 110 110 action: 'migrate_coauthors', 111 nonce: this.props.nonce,112 chunkSize: this.state.chunkSize111 nonce: self.props.nonce, 112 chunkSize: self.state.chunkSize 113 113 }, 114 114 success: function (response) { … … 195 195 data: { 196 196 action: 'deactivate_coauthors_plus', 197 nonce: this.props.nonce197 nonce: self.props.nonce 198 198 }, 199 199 success: function (response) { -
publishpress-authors/tags/4.7.2/src/modules/multiple-authors/multiple-authors.php
r3115415 r3169244 3762 3762 ); 3763 3763 3764 if (!empty($_REQUEST['ppma_tab'])) { 3765 wp_localize_script('multiple-authors-settings', 'ppmaSettings', [ 3766 'tab' => 'ppma-tab-' . sanitize_key($_REQUEST['ppma_tab']), 3767 'runScript' => !empty($_REQUEST['ppma_maint']) ? sanitize_key($_REQUEST['ppma_maint']) : '', 3768 ]); 3769 } 3764 wp_localize_script('multiple-authors-settings', 'ppmaSettings', [ 3765 'tab' => !empty($_REQUEST['ppma_tab']) ? 'ppma-tab-' . sanitize_key($_REQUEST['ppma_tab']) : '', 3766 'runScript' => !empty($_REQUEST['ppma_maint']) ? sanitize_key($_REQUEST['ppma_maint']) : '', 3767 ]); 3770 3768 3771 3769 wp_enqueue_script( -
publishpress-authors/trunk/defines.php
r3115415 r3169244 13 13 14 14 if (!defined('PP_AUTHORS_LOADED')) { 15 define('PP_AUTHORS_VERSION', '4.7. 1');15 define('PP_AUTHORS_VERSION', '4.7.2'); 16 16 define('PP_AUTHORS_FILE', 'publishpress-authors/publishpress-authors.php'); 17 17 define('PP_AUTHORS_BASE_PATH', plugin_dir_path(__DIR__ . '/publishpress-authors.php')); -
publishpress-authors/trunk/languages/publishpress-authors.pot
r3115415 r3169244 3 3 msgstr "" 4 4 "Project-Id-Version: PublishPress Authors\n" 5 "POT-Creation-Date: 2024- 07-10 07:21+0000\n"5 "POT-Creation-Date: 2024-10-14 09:25+0000\n" 6 6 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 7 7 "Last-Translator: Anderson Grudtner Martins <[email protected]>\n" … … 521 521 msgstr "" 522 522 523 #: src/core/Classes/Author_Editor.php: 978523 #: src/core/Classes/Author_Editor.php:1007 524 524 msgid "An author email is required when creating new User Author." 525 525 msgstr "" 526 526 527 #: src/core/Classes/Author_Editor.php:9 48528 #: src/core/Classes/Author_Editor.php:9 66527 #: src/core/Classes/Author_Editor.php:977 528 #: src/core/Classes/Author_Editor.php:995 529 529 msgid "An author with the name provided already exists." 530 530 msgstr "" … … 819 819 msgstr "" 820 820 821 #: src/core/Classes/Author_Editor.php:7 30821 #: src/core/Classes/Author_Editor.php:759 822 822 msgid "Author Email" 823 823 msgstr "" … … 983 983 #: src/core/Authors_Widget.php:138 src/core/Plugin.php:856 984 984 #: src/core/Classes/Post_Editor.php:94 src/core/Classes/Post_Editor.php:206 985 #: src/core/Traits/Author_box.php:1 89985 #: src/core/Traits/Author_box.php:193 986 986 #: src/modules/author-categories/author-categories.php:624 987 987 #: src/modules/author-list/author-list.php:402 … … 1315 1315 msgstr "" 1316 1316 1317 #: src/modules/multiple-authors/multiple-authors.php:439 51317 #: src/modules/multiple-authors/multiple-authors.php:4393 1318 1318 msgid "Click to run the update now" 1319 1319 msgstr "" … … 1334 1334 #: src/modules/byline-migration/byline-migration.php:145 1335 1335 #: src/modules/bylines-migration/bylines-migration.php:147 1336 #: src/modules/multiple-authors/multiple-authors.php:38 611336 #: src/modules/multiple-authors/multiple-authors.php:3859 1337 1337 msgid "Collecting data for the migration..." 1338 1338 msgstr "" 1339 1339 1340 #: src/modules/multiple-authors/multiple-authors.php:379 31341 #: src/modules/multiple-authors/multiple-authors.php:382 41340 #: src/modules/multiple-authors/multiple-authors.php:3791 1341 #: src/modules/multiple-authors/multiple-authors.php:3822 1342 1342 msgid "Collecting data..." 1343 1343 msgstr "" … … 1370 1370 msgstr "" 1371 1371 1372 #: src/core/Classes/Author_Editor.php:8 091373 msgid "Convert into GuestAuthor With User Account"1372 #: src/core/Classes/Author_Editor.php:838 1373 msgid "Convert to Registered Author With User Account" 1374 1374 msgstr "" 1375 1375 … … 1397 1397 msgstr "" 1398 1398 1399 #: src/modules/multiple-authors/multiple-authors.php:386 61399 #: src/modules/multiple-authors/multiple-authors.php:3864 1400 1400 msgid "Copy Co-Authors Plus data" 1401 1401 msgstr "" … … 1412 1412 #: src/modules/byline-migration/byline-migration.php:149 1413 1413 #: src/modules/bylines-migration/bylines-migration.php:151 1414 #: src/modules/multiple-authors/multiple-authors.php:386 51414 #: src/modules/multiple-authors/multiple-authors.php:3863 1415 1415 msgid "Copying authors' data..." 1416 1416 msgstr "" 1417 1417 1418 #: src/core/Classes/Author_Editor.php:7 041418 #: src/core/Classes/Author_Editor.php:733 1419 1419 msgid "" 1420 1420 "Create an author profile and a linked user account. This account will be in " … … 1423 1423 msgstr "" 1424 1424 1425 #: src/core/Classes/Author_Editor.php: 6981425 #: src/core/Classes/Author_Editor.php:727 1426 1426 msgid "" 1427 1427 "Create an author profile for a current user account. You can select users " … … 1430 1430 msgstr "" 1431 1431 1432 #: src/core/Classes/Author_Editor.php:7 111432 #: src/core/Classes/Author_Editor.php:740 1433 1433 msgid "" 1434 1434 "Create an author profile with no linked user account. This option is " … … 1474 1474 msgstr "" 1475 1475 1476 #: src/modules/multiple-authors/multiple-authors.php:386 31476 #: src/modules/multiple-authors/multiple-authors.php:3861 1477 1477 msgid "Creating missed post authors...." 1478 1478 msgstr "" … … 1548 1548 msgstr "" 1549 1549 1550 #: src/modules/multiple-authors/multiple-authors.php:386 91550 #: src/modules/multiple-authors/multiple-authors.php:3867 1551 1551 msgid "Deactivate Co-Authors Plus" 1552 1552 msgstr "" … … 1560 1560 msgstr "" 1561 1561 1562 #: src/modules/multiple-authors/multiple-authors.php:386 71562 #: src/modules/multiple-authors/multiple-authors.php:3865 1563 1563 msgid "Deactivating Co-uthors Plus..." 1564 1564 msgstr "" … … 1695 1695 msgstr "" 1696 1696 1697 #: src/modules/multiple-authors/multiple-authors.php:432 71698 #: src/modules/multiple-authors/multiple-authors.php:4 4011697 #: src/modules/multiple-authors/multiple-authors.php:4325 1698 #: src/modules/multiple-authors/multiple-authors.php:4399 1699 1699 msgid "Dismiss" 1700 1700 msgstr "" … … 1791 1791 msgstr "" 1792 1792 1793 #: src/modules/multiple-authors/multiple-authors.php:382 61793 #: src/modules/multiple-authors/multiple-authors.php:3824 1794 1794 msgid "Done! %d authors were updated." 1795 1795 msgstr "" 1796 1796 1797 #: src/modules/multiple-authors/multiple-authors.php:379 51797 #: src/modules/multiple-authors/multiple-authors.php:3793 1798 1798 msgid "Done! %d posts were updated." 1799 1799 msgstr "" … … 1815 1815 msgstr "" 1816 1816 1817 #: src/modules/multiple-authors/multiple-authors.php:38 701817 #: src/modules/multiple-authors/multiple-authors.php:3868 1818 1818 msgid "Done! Co-Authors Plus data was copied." 1819 1819 msgstr "" 1820 1820 1821 #: src/modules/multiple-authors/multiple-authors.php:386 81821 #: src/modules/multiple-authors/multiple-authors.php:3866 1822 1822 msgid "Done! Co-Authors Plus is deactivated." 1823 1823 msgstr "" … … 2002 2002 #: src/modules/byline-migration/byline-migration.php:146 2003 2003 #: src/modules/bylines-migration/bylines-migration.php:148 2004 #: src/modules/multiple-authors/multiple-authors.php:386 22004 #: src/modules/multiple-authors/multiple-authors.php:3860 2005 2005 msgid "Error: " 2006 2006 msgstr "" … … 2104 2104 msgstr "" 2105 2105 2106 #: src/modules/multiple-authors/multiple-authors.php:379 42107 #: src/modules/multiple-authors/multiple-authors.php:382 52106 #: src/modules/multiple-authors/multiple-authors.php:3792 2107 #: src/modules/multiple-authors/multiple-authors.php:3823 2108 2108 msgid "Finishing the process..." 2109 2109 msgstr "" … … 2188 2188 msgstr "" 2189 2189 2190 #: src/modules/multiple-authors/multiple-authors.php:478 62190 #: src/modules/multiple-authors/multiple-authors.php:4784 2191 2191 msgid "Guest Author cannot login on the site." 2192 2192 msgstr "" 2193 2193 2194 2194 #: src/core/Classes/Author_Editor.php:121 2195 #: src/core/Classes/Author_Editor.php:7 102195 #: src/core/Classes/Author_Editor.php:739 2196 2196 #: src/modules/author-list/author-list.php:979 2197 2197 msgid "Guest Author With No User Account" … … 2199 2199 2200 2200 #: src/core/Classes/Author_Editor.php:117 2201 #: src/core/Classes/Author_Editor.php:7 032201 #: src/core/Classes/Author_Editor.php:732 2202 2202 #: src/modules/author-list/author-list.php:978 2203 2203 msgid "Guest Author With User Account" … … 2425 2425 msgstr "" 2426 2426 2427 #: src/modules/multiple-authors/multiple-authors.php:43 212427 #: src/modules/multiple-authors/multiple-authors.php:4319 2428 2428 msgid "It looks like you have Co-Authors Plus installed." 2429 2429 msgstr "" … … 2555 2555 msgstr "" 2556 2556 2557 #: src/core/Classes/Admin_Ajax.php:346 src/core/Classes/Author_Editor.php:10 142557 #: src/core/Classes/Admin_Ajax.php:346 src/core/Classes/Author_Editor.php:1043 2558 2558 msgid "Mapped user is required." 2559 2559 msgstr "" … … 2661 2661 msgstr "" 2662 2662 2663 #: src/core/Classes/Author_Editor.php: 8782663 #: src/core/Classes/Author_Editor.php:907 2664 2664 msgid "No authors were updated" 2665 2665 msgstr "" … … 2825 2825 msgstr "" 2826 2826 2827 #: src/modules/multiple-authors/multiple-authors.php:432 22827 #: src/modules/multiple-authors/multiple-authors.php:4320 2828 2828 msgid "Please click here and read this guide!" 2829 2829 msgstr "" … … 2844 2844 #: src/modules/byline-migration/byline-migration.php:148 2845 2845 #: src/modules/bylines-migration/bylines-migration.php:150 2846 #: src/modules/multiple-authors/multiple-authors.php:379 62847 #: src/modules/multiple-authors/multiple-authors.php:382 72848 #: src/modules/multiple-authors/multiple-authors.php:386 42846 #: src/modules/multiple-authors/multiple-authors.php:3794 2847 #: src/modules/multiple-authors/multiple-authors.php:3825 2848 #: src/modules/multiple-authors/multiple-authors.php:3862 2849 2849 msgid "Please, wait..." 2850 2850 msgstr "" … … 2959 2959 msgstr "" 2960 2960 2961 #: src/modules/multiple-authors/multiple-authors.php:439 42961 #: src/modules/multiple-authors/multiple-authors.php:4392 2962 2962 msgid "" 2963 2963 "PublishPress Authors needs a database update for Permissions integration." … … 3086 3086 3087 3087 #: src/core/Classes/Author_Editor.php:119 3088 #: src/core/Classes/Author_Editor.php: 6973088 #: src/core/Classes/Author_Editor.php:726 3089 3089 #: src/modules/author-list/author-list.php:977 3090 3090 msgid "Registered Author With User Account" … … 3292 3292 msgstr "" 3293 3293 3294 #: src/core/Classes/Author_Editor.php:7 423294 #: src/core/Classes/Author_Editor.php:771 3295 3295 msgid "Select Author Account" 3296 3296 msgstr "" … … 3548 3548 msgstr "" 3549 3549 3550 #: src/core/Classes/Admin_Ajax.php:334 src/core/Classes/Author_Editor.php:9 223550 #: src/core/Classes/Admin_Ajax.php:334 src/core/Classes/Author_Editor.php:951 3551 3551 msgid "" 3552 3552 "Sorry, this WordPress user is already mapped to another Author. By default, " … … 3576 3576 msgstr "" 3577 3577 3578 #: src/core/Classes/Author_Editor.php:8 053579 #: src/modules/multiple-authors/multiple-authors.php:379 23578 #: src/core/Classes/Author_Editor.php:834 3579 #: src/modules/multiple-authors/multiple-authors.php:3790 3580 3580 msgid "Sync author and user fields" 3581 3581 msgstr "" 3582 3582 3583 #: src/modules/multiple-authors/multiple-authors.php:382 33583 #: src/modules/multiple-authors/multiple-authors.php:3821 3584 3584 msgid "Sync author and user URLs" 3585 3585 msgstr "" … … 3863 3863 msgstr "" 3864 3864 3865 #: src/core/Classes/Author_Editor.php:8 133865 #: src/core/Classes/Author_Editor.php:842 3866 3866 msgid "Update post count" 3867 3867 msgstr "" 3868 3868 3869 #: src/core/Classes/Author_Editor.php: 8813869 #: src/core/Classes/Author_Editor.php:910 3870 3870 msgid "Updated %d authors" 3871 3871 msgstr "" 3872 3872 3873 #: src/modules/multiple-authors/multiple-authors.php:382 93873 #: src/modules/multiple-authors/multiple-authors.php:3827 3874 3874 msgid "Updated %d of %d authors..." 3875 3875 msgstr "" 3876 3876 3877 #: src/modules/multiple-authors/multiple-authors.php:379 83877 #: src/modules/multiple-authors/multiple-authors.php:3796 3878 3878 msgid "Updated %d of %d posts..." 3879 3879 msgstr "" 3880 3880 3881 #: src/modules/multiple-authors/multiple-authors.php:379 73881 #: src/modules/multiple-authors/multiple-authors.php:3795 3882 3882 msgid "Updating author field on posts..." 3883 3883 msgstr "" 3884 3884 3885 #: src/modules/multiple-authors/multiple-authors.php:382 83885 #: src/modules/multiple-authors/multiple-authors.php:3826 3886 3886 msgid "Updating authors slug..." 3887 3887 msgstr "" -
publishpress-authors/trunk/publishpress-authors.php
r3115415 r3169244 6 6 * Author: PublishPress 7 7 * Author URI: https://publishpress.com 8 * Version: 4.7. 18 * Version: 4.7.2 9 9 * Text Domain: publishpress-authors 10 10 * Domain Path: /languages -
publishpress-authors/trunk/readme.txt
r3115415 r3169244 7 7 Requires at least: 5.5 8 8 Requires PHP: 7.2.5 9 Tested up to: 6. 510 Stable tag: 4.7. 19 Tested up to: 6.6 10 Stable tag: 4.7.2 11 11 License: GPLv2 or later 12 12 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 246 246 247 247 == Changelog == 248 249 = [4.7.2] - 15 Oct 2024 = 250 251 * Update: Improve Author User data update capability check 252 * Fixed: Fix Guest Author conversion not working for Author without email, #1908 253 * Update: Brazil Translation Update, #1910 248 254 249 255 = [4.7.1] - 10 July 2024 = -
publishpress-authors/trunk/src/assets/js/coauthors-migration.min.js
r3096813 r3169244 1 !function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=13)}([function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}},function(t,e,r){var n=r(6),o=r(0);t.exports=function(t,e){return!e||"object"!==n(e)&&"function"!=typeof e?o(t):e}},function(t,e){function r(e){return t.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},r(e)}t.exports=r},function(t,e,r){var n=r(7);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&n(t,e)}},function(t,e){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=r=function(t){return typeof t}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(e)}t.exports=r},function(t,e){function r(e,n){return t.exports=r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(e,n)}t.exports=r},,,,,,function(t,e,r){"use strict";r.r(e);var n=r(1),o=r.n(n),a=r(2),i=r.n(a),s=r(3),u=r.n(s),c=r(4),l=r.n(c),p=r(0),g=r.n(p), h=r(5),f=r.n(h),d=function(t){function e(t){var r;return o()(this,e),(r=u()(this,l()(e).call(this,t))).renderDeactivatePluginOption=r.renderDeactivatePluginOption.bind(g()(r)),r.renderProgressBar=r.renderProgressBar.bind(g()(r)),r.renderLog=r.renderLog.bind(g()(r)),r.deactivateCoAuthorsPlus=r.deactivateCoAuthorsPlus.bind(g()(r)),r.startMigration=r.startMigration.bind(g()(r)),r.clickStart=r.clickStart.bind(g()(r)),r.reset=r.reset.bind(g()(r)),r.migrateChunkOfData=r.migrateChunkOfData.bind(g()(r)),r.getCoAuthorsMigrationInitialData=r.getCoAuthorsMigrationInitialData.bind(g()(r)),r.state={totalToMigrate:0,totalMigrated:0,inProgress:!1,chunkSize:r.props.chunkSize,progress:0,log:"",showDeactivateOption:!1,disablingCoAuthors:!1},r}return f()(e,t),i()(e,[{key:"clickStart",value:function(t){t.preventDefault(),this.startMigration()}},{key:"getCoAuthorsMigrationInitialData",value:function(t){var e=this;this.setState({log:ppmaCoAuthorsMigration.start_message}),window.setTimeout((function(){jQuery.ajax({type:"GET",dataType:"json",url:ajaxurl,async:!1,data:{action:"get_coauthors_migration_data",nonce:this.props.nonce},success:function(r){e.setState({totalToMigrate:r.total}),t()},error:function(t,r,n){e.setState({progress:0,inProgress:!1,log:ppmaCoAuthorsMigration.error_message+n+" ["+r+"]",showDeactivateOption:!1})}})}),1e3)}},{key:"finishCoAuthorsMigration",value:function(t){this.setState({progress:99,log:ppmaCoAuthorsMigration.progress_message}),window.setTimeout((function(){jQuery.ajax({type:"GET",dataType:"json",url:ajaxurl,async:!1,data:{action:"finish_coauthors_migration",nonce:this.props.nonce},success:function(){t()},error:function(t,e,r){this.setState({progress:0,inProgress:!1,log:ppmaCoAuthorsMigration.error_message+r+" ["+e+"]",showDeactivateOption:!1})}})}),1e3)}},{key:"migrateChunkOfData",value:function(){var t=this;jQuery.ajax({type:"GET",dataType:"json",url:ajaxurl,data:{action:"migrate_coauthors",nonce:this.props.nonce,chunkSize:this.state.chunkSize},success:function(){var e=t.state.totalMigrated+t.state.chunkSize;e>t.state.totalToMigrate&&(e=t.state.totalToMigrate),t.setState({totalMigrated:e,progress:2+Math.floor(98/t.state.totalToMigrate*e)}),e<t.state.totalToMigrate?t.migrateChunkOfData():t.finishCoAuthorsMigration((function(){t.setState({progress:100,log:ppmaCoAuthorsMigration.completed_message,showDeactivateOption:!0}),window.setTimeout((function(){t.setState({inProgress:!1})}),1e3)}))},error:function(e,r,n){t.setState({progress:0,inProgress:!1,log:ppmaCoAuthorsMigration.error_message+n+" ["+r+"]",showDeactivateOption:!1})}})}},{key:"startMigration",value:function(){var t=this;this.setState({progress:1,inProgress:!0,log:ppmaCoAuthorsMigration.wait_message,showDeactivateOption:!1}),window.setTimeout((function(){t.getCoAuthorsMigrationInitialData((function(){t.setState({progress:2,log:ppmaCoAuthorsMigration.copying_message}),t.migrateChunkOfData()}))}),1e3)}},{key:"deactivateCoAuthorsPlus",value:function(){var t=this;this.setState({disablingCoAuthors:!0,log:ppmaCoAuthorsMigration.deactivating_message}),jQuery.ajax({type:"GET",dataType:"json",url:ajaxurl,data:{action:"deactivate_coauthors_plus",nonce:this.props.nonce},success:function(){t.setState({disablingCoAuthors:!1,log:ppmaCoAuthorsMigration.deactivated_message,showDeactivateOption:!1})},error:function(e,r,n){t.setState({disablingCoAuthors:!1,log:ppmaCoAuthorsMigration.error_message+n+" ["+r+"]"})}})}},{key:"renderDeactivatePluginOption",value:function(){var t=ppmaCoAuthorsMigration.deactivate_message,e=!this.state.disablingCoAuthors;return wp.element.createElement(m,{label:t,onClick:this.deactivateCoAuthorsPlus,enabled:e})}},{key:"reset",value:function(){this.setState({progress:0,inProgress:!1})}},{key:"renderProgressBar",value:function(){return wp.element.createElement(y,{value:this.state.progress})}},{key:"renderLog",value:function(){return wp.element.createElement(v,{log:this.state.log,show:this.state.showDeactivateOption})}},{key:"render",value:function(){var t=!this.state.inProgress,e=this.state.inProgress?this.renderProgressBar():"",r=""==this.state.log?"":this.renderLog(),n=this.state.showDeactivateOption?this.renderDeactivatePluginOption():"";return wp.element.createElement("div",null,wp.element.createElement(m,{label:ppmaCoAuthorsMigration.copy_message,onClick:this.startMigration,enabled:t}),n,e,r)}}]),e}(React.Component),m=function(t){function e(t){return o()(this,e),u()(this,l()(e).call(this,t))}return f()(e,t),i()(e,[{key:"render",value:function(){var t=!this.props.enabled;return wp.element.createElement("input",{type:"button",className:"button button-secondary button-danger ppma_maintenance_button",onClick:this.props.onClick,disabled:t,value:this.props.label})}}]),e}(React.Component),v=function(t){function e(t){return o()(this,e),u()(this,l()(e).call(this,t))}return f()(e,t),i()(e,[{key:"render",value:function(){return wp.element.createElement("div",null,wp.element.createElement("div",{class:"ppma_maintenance_log",readOnly:!0},this.props.log))}}]),e}(React.Component),y=function(t){function e(t){return o()(this,e),u()(this,l()(e).call(this,t))}return f()(e,t),i()(e,[{key:"renderLabel",value:function(){return wp.element.createElement("div",{className:"p-progressbar-label"},this.props.value," %")}},{key:"render",value:function(){var t=this.renderLabel();return wp.element.createElement("div",{role:"progressbar",id:this.props.id,className:"p-progressbar p-component p-progressbar-determinate",style:this.props.style,"aria-valuemin":"0","aria-valuenow":this.props.value,"aria-valuemax":"100","aria-label":this.props.value},wp.element.createElement("div",{className:"p-progressbar-value p-progressbar-value-animate",style:{width:this.props.value+"%",display:"block"}}),t)}}]),e}(React.Component);jQuery((function(){ReactDOM.render(wp.element.createElement(d,{notMigratedPostsId:ppmaCoAuthorsMigration.notMigratedPostsId,nonce:ppmaCoAuthorsMigration.nonce,chunkSize:5}),document.getElementById("publishpress-authors-coauthors-migration"))}))}]);1 !function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=13)}([function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}},function(t,e,r){var n=r(6),o=r(0);t.exports=function(t,e){return!e||"object"!==n(e)&&"function"!=typeof e?o(t):e}},function(t,e){function r(e){return t.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},r(e)}t.exports=r},function(t,e,r){var n=r(7);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&n(t,e)}},function(t,e){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=r=function(t){return typeof t}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(e)}t.exports=r},function(t,e){function r(e,n){return t.exports=r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(e,n)}t.exports=r},,,,,,function(t,e,r){"use strict";r.r(e);var n=r(1),o=r.n(n),a=r(2),i=r.n(a),s=r(3),u=r.n(s),c=r(4),l=r.n(c),p=r(0),g=r.n(p),f=r(5),h=r.n(f),d=function(t){function e(t){var r;return o()(this,e),(r=u()(this,l()(e).call(this,t))).renderDeactivatePluginOption=r.renderDeactivatePluginOption.bind(g()(r)),r.renderProgressBar=r.renderProgressBar.bind(g()(r)),r.renderLog=r.renderLog.bind(g()(r)),r.deactivateCoAuthorsPlus=r.deactivateCoAuthorsPlus.bind(g()(r)),r.startMigration=r.startMigration.bind(g()(r)),r.clickStart=r.clickStart.bind(g()(r)),r.reset=r.reset.bind(g()(r)),r.migrateChunkOfData=r.migrateChunkOfData.bind(g()(r)),r.getCoAuthorsMigrationInitialData=r.getCoAuthorsMigrationInitialData.bind(g()(r)),r.state={totalToMigrate:0,totalMigrated:0,inProgress:!1,chunkSize:r.props.chunkSize,progress:0,log:"",showDeactivateOption:!1,disablingCoAuthors:!1},r}return h()(e,t),i()(e,[{key:"clickStart",value:function(t){t.preventDefault(),this.startMigration()}},{key:"getCoAuthorsMigrationInitialData",value:function(t){var e=this;this.setState({log:ppmaCoAuthorsMigration.start_message}),window.setTimeout((function(){jQuery.ajax({type:"GET",dataType:"json",url:ajaxurl,async:!1,data:{action:"get_coauthors_migration_data",nonce:e.props.nonce},success:function(r){e.setState({totalToMigrate:r.total}),t()},error:function(t,r,n){e.setState({progress:0,inProgress:!1,log:ppmaCoAuthorsMigration.error_message+n+" ["+r+"]",showDeactivateOption:!1})}})}),1e3)}},{key:"finishCoAuthorsMigration",value:function(t){var e=this;this.setState({progress:99,log:ppmaCoAuthorsMigration.progress_message}),window.setTimeout((function(){jQuery.ajax({type:"GET",dataType:"json",url:ajaxurl,async:!1,data:{action:"finish_coauthors_migration",nonce:e.props.nonce},success:function(){t()},error:function(t,r,n){e.setState({progress:0,inProgress:!1,log:ppmaCoAuthorsMigration.error_message+n+" ["+r+"]",showDeactivateOption:!1})}})}),1e3)}},{key:"migrateChunkOfData",value:function(){var t=this;jQuery.ajax({type:"GET",dataType:"json",url:ajaxurl,data:{action:"migrate_coauthors",nonce:t.props.nonce,chunkSize:t.state.chunkSize},success:function(){var e=t.state.totalMigrated+t.state.chunkSize;e>t.state.totalToMigrate&&(e=t.state.totalToMigrate),t.setState({totalMigrated:e,progress:2+Math.floor(98/t.state.totalToMigrate*e)}),e<t.state.totalToMigrate?t.migrateChunkOfData():t.finishCoAuthorsMigration((function(){t.setState({progress:100,log:ppmaCoAuthorsMigration.completed_message,showDeactivateOption:!0}),window.setTimeout((function(){t.setState({inProgress:!1})}),1e3)}))},error:function(e,r,n){t.setState({progress:0,inProgress:!1,log:ppmaCoAuthorsMigration.error_message+n+" ["+r+"]",showDeactivateOption:!1})}})}},{key:"startMigration",value:function(){var t=this;this.setState({progress:1,inProgress:!0,log:ppmaCoAuthorsMigration.wait_message,showDeactivateOption:!1}),window.setTimeout((function(){t.getCoAuthorsMigrationInitialData((function(){t.setState({progress:2,log:ppmaCoAuthorsMigration.copying_message}),t.migrateChunkOfData()}))}),1e3)}},{key:"deactivateCoAuthorsPlus",value:function(){var t=this;this.setState({disablingCoAuthors:!0,log:ppmaCoAuthorsMigration.deactivating_message}),jQuery.ajax({type:"GET",dataType:"json",url:ajaxurl,data:{action:"deactivate_coauthors_plus",nonce:t.props.nonce},success:function(){t.setState({disablingCoAuthors:!1,log:ppmaCoAuthorsMigration.deactivated_message,showDeactivateOption:!1})},error:function(e,r,n){t.setState({disablingCoAuthors:!1,log:ppmaCoAuthorsMigration.error_message+n+" ["+r+"]"})}})}},{key:"renderDeactivatePluginOption",value:function(){var t=ppmaCoAuthorsMigration.deactivate_message,e=!this.state.disablingCoAuthors;return wp.element.createElement(m,{label:t,onClick:this.deactivateCoAuthorsPlus,enabled:e})}},{key:"reset",value:function(){this.setState({progress:0,inProgress:!1})}},{key:"renderProgressBar",value:function(){return wp.element.createElement(y,{value:this.state.progress})}},{key:"renderLog",value:function(){return wp.element.createElement(v,{log:this.state.log,show:this.state.showDeactivateOption})}},{key:"render",value:function(){var t=!this.state.inProgress,e=this.state.inProgress?this.renderProgressBar():"",r=""==this.state.log?"":this.renderLog(),n=this.state.showDeactivateOption?this.renderDeactivatePluginOption():"";return wp.element.createElement("div",null,wp.element.createElement(m,{label:ppmaCoAuthorsMigration.copy_message,onClick:this.startMigration,enabled:t}),n,e,r)}}]),e}(React.Component),m=function(t){function e(t){return o()(this,e),u()(this,l()(e).call(this,t))}return h()(e,t),i()(e,[{key:"render",value:function(){var t=!this.props.enabled;return wp.element.createElement("input",{type:"button",className:"button button-secondary button-danger ppma_maintenance_button",onClick:this.props.onClick,disabled:t,value:this.props.label})}}]),e}(React.Component),v=function(t){function e(t){return o()(this,e),u()(this,l()(e).call(this,t))}return h()(e,t),i()(e,[{key:"render",value:function(){return wp.element.createElement("div",null,wp.element.createElement("div",{class:"ppma_maintenance_log",readOnly:!0},this.props.log))}}]),e}(React.Component),y=function(t){function e(t){return o()(this,e),u()(this,l()(e).call(this,t))}return h()(e,t),i()(e,[{key:"renderLabel",value:function(){return wp.element.createElement("div",{className:"p-progressbar-label"},this.props.value," %")}},{key:"render",value:function(){var t=this.renderLabel();return wp.element.createElement("div",{role:"progressbar",id:this.props.id,className:"p-progressbar p-component p-progressbar-determinate",style:this.props.style,"aria-valuemin":"0","aria-valuenow":this.props.value,"aria-valuemax":"100","aria-label":this.props.value},wp.element.createElement("div",{className:"p-progressbar-value p-progressbar-value-animate",style:{width:this.props.value+"%",display:"block"}}),t)}}]),e}(React.Component);jQuery((function(){ReactDOM.render(wp.element.createElement(d,{notMigratedPostsId:ppmaCoAuthorsMigration.notMigratedPostsId,nonce:ppmaCoAuthorsMigration.nonce,chunkSize:5}),document.getElementById("publishpress-authors-coauthors-migration"))}))}]); -
publishpress-authors/trunk/src/assets/js/settings.js
r3105206 r3169244 25 25 var ppmaTab = 'ppma-tab-general'; 26 26 27 if (typeof ppmaSettings != 'undefined' && typeof ppmaSettings.tab != 'undefined' ) {27 if (typeof ppmaSettings != 'undefined' && typeof ppmaSettings.tab != 'undefined' && ppmaSettings.tab !== '') { 28 28 ppmaTab = ppmaSettings.tab; 29 29 $('#publishpress-authors-settings-tabs a[href="#' + ppmaTab + '"]').click(); -
publishpress-authors/trunk/src/core/Classes/Author_Editor.php
r3115415 r3169244 583 583 { 584 584 if (empty($_POST['author-edit-nonce']) 585 || !is_user_logged_in() 585 586 || !wp_verify_nonce(sanitize_key($_POST['author-edit-nonce']), 'author-edit')) { 586 587 return; … … 597 598 $user = false; 598 599 $user_id = false; 599 } else { 600 $updated_args['ID'] = $user_id; 601 } 600 } 601 } 602 603 /** 604 * Make sure current user is set as user ID if user does not 605 * have capability to edit other authors/users. 606 * 607 * Note: Prevent ability to edit administrator completely. 608 */ 609 if ($user && (int)$user_id !== get_current_user_id()) { 610 611 // Prevent editing administrators completely 612 if (in_array('administrator', $user->roles)) { 613 $user_id = false; 614 $user = false; 615 } 616 // Check if the user lacks the necessary capabilities and fallback to current user 617 elseif (!current_user_can(get_taxonomy('author')->cap->manage_terms) 618 || !current_user_can('edit_user', $user_id)) { 619 // Fallback to current user if they lack permissions 620 $user_id = get_current_user_id(); 621 $user = get_user_by('id', $user_id); 622 } 623 } 624 625 if ($user) { 626 $updated_args['ID'] = $user_id; 602 627 } 603 628 … … 607 632 } 608 633 $sanitize = isset($args['sanitize']) ? $args['sanitize'] : 'sanitize_text_field'; 609 $field_value = $sanitize($_POST['authors-' . $key]); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized 634 if ($key == 'user_id') { 635 $field_value = $user_id; 636 } else { 637 $field_value = $sanitize($_POST['authors-' . $key]); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized 638 } 610 639 update_term_meta($term_id, $key, $field_value); 611 640 if ($user_id) { … … 808 837 ); 809 838 $bulk_actions['convert_into_guest_author'] = __( 810 'Convert into GuestAuthor With User Account',839 'Convert to Registered Author With User Account', 811 840 'publishpress-authors' 812 841 ); -
publishpress-authors/trunk/src/core/Classes/Objects/Author.php
r3115415 r3169244 342 342 $userId = get_term_meta($term_id, 'user_id', true); 343 343 $author = Author::get_by_term_id($term_id); 344 345 $new_author_email = !empty($author->user_email) ? $author->user_email : self::generate_random_domain_email($term_id); 346 344 347 if ($userId && is_object($author) && isset($author->display_name)) { 345 348 $user_data = [ … … 350 353 update_term_meta($term_id, 'user_id', $userId); 351 354 update_term_meta($term_id, 'user_id_' . $userId, $userId); 352 } else if (!empty($author->user_email)){355 } else { 353 356 $user_data = [ 354 'user_login' => !empty($author->user_login)? $author->user_login : sanitize_title($ author->user_email),357 'user_login' => !empty($author->user_login)? $author->user_login : sanitize_title($new_author_email), 355 358 'display_name' => $author->display_name, 356 'user_email' => $ author->user_email,359 'user_email' => $new_author_email, 357 360 'user_pass' => wp_generate_password(), 358 361 'role' => 'ppma_guest_author', 359 362 ]; 360 363 $userId = wp_insert_user($user_data); 361 364 362 365 if (!is_wp_error($userId)) { 366 update_term_meta($term_id, 'user_email', $new_author_email); 363 367 update_term_meta($term_id, 'user_id', $userId); 364 368 update_term_meta($term_id, 'user_id_' . $userId, $userId); 365 369 } 366 } else { 367 delete_term_meta($term_id, 'user_id'); 368 delete_term_meta($term_id, 'user_id_' . $userId); 369 } 370 } 371 } 372 373 /** 374 * Generate random domain email 375 */ 376 public static function generate_random_domain_email($unique_id = '') { 377 // Get current timestamp 378 $timestamp = $unique_id . time(); 379 380 // Get website domain 381 $domain = parse_url(get_bloginfo('url'), PHP_URL_HOST); 382 383 // Generate the email 384 $random_email = 'guestauthor+' . $timestamp . '@' . $domain; 385 386 return $random_email; 370 387 } 371 388 … … 747 764 $urls = $this->get_custom_avatar_url($size); 748 765 766 $imageId = attachment_url_to_postid($urls['url']); 767 749 768 $class = [ 750 769 'multiple_authors_guest_author_avatar', … … 752 771 ]; 753 772 754 $alt = $this->display_name;773 $alt = get_post_meta( $imageId, '_wp_attachment_image_alt', true ); 755 774 756 775 // Build the HTML tag. -
publishpress-authors/trunk/src/core/Traits/Author_box.php
r3087197 r3169244 176 176 } 177 177 } 178 } 179 180 if (empty($authorsList)) { 181 return ''; 178 182 } 179 183 -
publishpress-authors/trunk/src/modules/multiple-authors/assets/js/coauthors-migration.jsx
r3096813 r3169244 46 46 data: { 47 47 action: 'get_coauthors_migration_data', 48 nonce: this.props.nonce48 nonce: self.props.nonce 49 49 }, 50 50 success: function (response) { … … 83 83 data: { 84 84 action: 'finish_coauthors_migration', 85 nonce: this.props.nonce85 nonce: self.props.nonce 86 86 }, 87 87 success: function (response) { … … 109 109 data: { 110 110 action: 'migrate_coauthors', 111 nonce: this.props.nonce,112 chunkSize: this.state.chunkSize111 nonce: self.props.nonce, 112 chunkSize: self.state.chunkSize 113 113 }, 114 114 success: function (response) { … … 195 195 data: { 196 196 action: 'deactivate_coauthors_plus', 197 nonce: this.props.nonce197 nonce: self.props.nonce 198 198 }, 199 199 success: function (response) { -
publishpress-authors/trunk/src/modules/multiple-authors/multiple-authors.php
r3115415 r3169244 3762 3762 ); 3763 3763 3764 if (!empty($_REQUEST['ppma_tab'])) { 3765 wp_localize_script('multiple-authors-settings', 'ppmaSettings', [ 3766 'tab' => 'ppma-tab-' . sanitize_key($_REQUEST['ppma_tab']), 3767 'runScript' => !empty($_REQUEST['ppma_maint']) ? sanitize_key($_REQUEST['ppma_maint']) : '', 3768 ]); 3769 } 3764 wp_localize_script('multiple-authors-settings', 'ppmaSettings', [ 3765 'tab' => !empty($_REQUEST['ppma_tab']) ? 'ppma-tab-' . sanitize_key($_REQUEST['ppma_tab']) : '', 3766 'runScript' => !empty($_REQUEST['ppma_maint']) ? sanitize_key($_REQUEST['ppma_maint']) : '', 3767 ]); 3770 3768 3771 3769 wp_enqueue_script(
Note: See TracChangeset
for help on using the changeset viewer.