Plugin Directory

Changeset 3169244


Ignore:
Timestamp:
10/15/2024 12:13:22 PM (16 months ago)
Author:
ojopaul
Message:

Releasing v4.7.2

Location:
publishpress-authors
Files:
22 edited
1 copied

Legend:

Unmodified
Added
Removed
  • publishpress-authors/tags/4.7.2/defines.php

    r3115415 r3169244  
    1313
    1414if (!defined('PP_AUTHORS_LOADED')) {
    15     define('PP_AUTHORS_VERSION', '4.7.1');
     15    define('PP_AUTHORS_VERSION', '4.7.2');
    1616    define('PP_AUTHORS_FILE', 'publishpress-authors/publishpress-authors.php');
    1717    define('PP_AUTHORS_BASE_PATH', plugin_dir_path(__DIR__ . '/publishpress-authors.php'));
  • publishpress-authors/tags/4.7.2/languages/publishpress-authors.pot

    r3115415 r3169244  
    33msgstr ""
    44"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"
    66"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    77"Last-Translator: Anderson Grudtner Martins <[email protected]>\n"
     
    521521msgstr ""
    522522
    523 #: src/core/Classes/Author_Editor.php:978
     523#: src/core/Classes/Author_Editor.php:1007
    524524msgid "An author email is required when creating new User Author."
    525525msgstr ""
    526526
    527 #: src/core/Classes/Author_Editor.php:948
    528 #: src/core/Classes/Author_Editor.php:966
     527#: src/core/Classes/Author_Editor.php:977
     528#: src/core/Classes/Author_Editor.php:995
    529529msgid "An author with the name provided already exists."
    530530msgstr ""
     
    819819msgstr ""
    820820
    821 #: src/core/Classes/Author_Editor.php:730
     821#: src/core/Classes/Author_Editor.php:759
    822822msgid "Author Email"
    823823msgstr ""
     
    983983#: src/core/Authors_Widget.php:138 src/core/Plugin.php:856
    984984#: src/core/Classes/Post_Editor.php:94 src/core/Classes/Post_Editor.php:206
    985 #: src/core/Traits/Author_box.php:189
     985#: src/core/Traits/Author_box.php:193
    986986#: src/modules/author-categories/author-categories.php:624
    987987#: src/modules/author-list/author-list.php:402
     
    13151315msgstr ""
    13161316
    1317 #: src/modules/multiple-authors/multiple-authors.php:4395
     1317#: src/modules/multiple-authors/multiple-authors.php:4393
    13181318msgid "Click to run the update now"
    13191319msgstr ""
     
    13341334#: src/modules/byline-migration/byline-migration.php:145
    13351335#: src/modules/bylines-migration/bylines-migration.php:147
    1336 #: src/modules/multiple-authors/multiple-authors.php:3861
     1336#: src/modules/multiple-authors/multiple-authors.php:3859
    13371337msgid "Collecting data for the migration..."
    13381338msgstr ""
    13391339
    1340 #: src/modules/multiple-authors/multiple-authors.php:3793
    1341 #: src/modules/multiple-authors/multiple-authors.php:3824
     1340#: src/modules/multiple-authors/multiple-authors.php:3791
     1341#: src/modules/multiple-authors/multiple-authors.php:3822
    13421342msgid "Collecting data..."
    13431343msgstr ""
     
    13701370msgstr ""
    13711371
    1372 #: src/core/Classes/Author_Editor.php:809
    1373 msgid "Convert into Guest Author With User Account"
     1372#: src/core/Classes/Author_Editor.php:838
     1373msgid "Convert to Registered Author With User Account"
    13741374msgstr ""
    13751375
     
    13971397msgstr ""
    13981398
    1399 #: src/modules/multiple-authors/multiple-authors.php:3866
     1399#: src/modules/multiple-authors/multiple-authors.php:3864
    14001400msgid "Copy Co-Authors Plus data"
    14011401msgstr ""
     
    14121412#: src/modules/byline-migration/byline-migration.php:149
    14131413#: src/modules/bylines-migration/bylines-migration.php:151
    1414 #: src/modules/multiple-authors/multiple-authors.php:3865
     1414#: src/modules/multiple-authors/multiple-authors.php:3863
    14151415msgid "Copying authors' data..."
    14161416msgstr ""
    14171417
    1418 #: src/core/Classes/Author_Editor.php:704
     1418#: src/core/Classes/Author_Editor.php:733
    14191419msgid ""
    14201420"Create an author profile and a linked user account. This account will be in "
     
    14231423msgstr ""
    14241424
    1425 #: src/core/Classes/Author_Editor.php:698
     1425#: src/core/Classes/Author_Editor.php:727
    14261426msgid ""
    14271427"Create an author profile for a current user account. You can select users "
     
    14301430msgstr ""
    14311431
    1432 #: src/core/Classes/Author_Editor.php:711
     1432#: src/core/Classes/Author_Editor.php:740
    14331433msgid ""
    14341434"Create an author profile with no linked user account. This option is "
     
    14741474msgstr ""
    14751475
    1476 #: src/modules/multiple-authors/multiple-authors.php:3863
     1476#: src/modules/multiple-authors/multiple-authors.php:3861
    14771477msgid "Creating missed post authors...."
    14781478msgstr ""
     
    15481548msgstr ""
    15491549
    1550 #: src/modules/multiple-authors/multiple-authors.php:3869
     1550#: src/modules/multiple-authors/multiple-authors.php:3867
    15511551msgid "Deactivate Co-Authors Plus"
    15521552msgstr ""
     
    15601560msgstr ""
    15611561
    1562 #: src/modules/multiple-authors/multiple-authors.php:3867
     1562#: src/modules/multiple-authors/multiple-authors.php:3865
    15631563msgid "Deactivating Co-uthors Plus..."
    15641564msgstr ""
     
    16951695msgstr ""
    16961696
    1697 #: src/modules/multiple-authors/multiple-authors.php:4327
    1698 #: src/modules/multiple-authors/multiple-authors.php:4401
     1697#: src/modules/multiple-authors/multiple-authors.php:4325
     1698#: src/modules/multiple-authors/multiple-authors.php:4399
    16991699msgid "Dismiss"
    17001700msgstr ""
     
    17911791msgstr ""
    17921792
    1793 #: src/modules/multiple-authors/multiple-authors.php:3826
     1793#: src/modules/multiple-authors/multiple-authors.php:3824
    17941794msgid "Done! %d authors were updated."
    17951795msgstr ""
    17961796
    1797 #: src/modules/multiple-authors/multiple-authors.php:3795
     1797#: src/modules/multiple-authors/multiple-authors.php:3793
    17981798msgid "Done! %d posts were updated."
    17991799msgstr ""
     
    18151815msgstr ""
    18161816
    1817 #: src/modules/multiple-authors/multiple-authors.php:3870
     1817#: src/modules/multiple-authors/multiple-authors.php:3868
    18181818msgid "Done! Co-Authors Plus data was copied."
    18191819msgstr ""
    18201820
    1821 #: src/modules/multiple-authors/multiple-authors.php:3868
     1821#: src/modules/multiple-authors/multiple-authors.php:3866
    18221822msgid "Done! Co-Authors Plus is deactivated."
    18231823msgstr ""
     
    20022002#: src/modules/byline-migration/byline-migration.php:146
    20032003#: src/modules/bylines-migration/bylines-migration.php:148
    2004 #: src/modules/multiple-authors/multiple-authors.php:3862
     2004#: src/modules/multiple-authors/multiple-authors.php:3860
    20052005msgid "Error: "
    20062006msgstr ""
     
    21042104msgstr ""
    21052105
    2106 #: src/modules/multiple-authors/multiple-authors.php:3794
    2107 #: src/modules/multiple-authors/multiple-authors.php:3825
     2106#: src/modules/multiple-authors/multiple-authors.php:3792
     2107#: src/modules/multiple-authors/multiple-authors.php:3823
    21082108msgid "Finishing the process..."
    21092109msgstr ""
     
    21882188msgstr ""
    21892189
    2190 #: src/modules/multiple-authors/multiple-authors.php:4786
     2190#: src/modules/multiple-authors/multiple-authors.php:4784
    21912191msgid "Guest Author cannot login on the site."
    21922192msgstr ""
    21932193
    21942194#: src/core/Classes/Author_Editor.php:121
    2195 #: src/core/Classes/Author_Editor.php:710
     2195#: src/core/Classes/Author_Editor.php:739
    21962196#: src/modules/author-list/author-list.php:979
    21972197msgid "Guest Author With No User Account"
     
    21992199
    22002200#: src/core/Classes/Author_Editor.php:117
    2201 #: src/core/Classes/Author_Editor.php:703
     2201#: src/core/Classes/Author_Editor.php:732
    22022202#: src/modules/author-list/author-list.php:978
    22032203msgid "Guest Author With User Account"
     
    24252425msgstr ""
    24262426
    2427 #: src/modules/multiple-authors/multiple-authors.php:4321
     2427#: src/modules/multiple-authors/multiple-authors.php:4319
    24282428msgid "It looks like you have Co-Authors Plus installed."
    24292429msgstr ""
     
    25552555msgstr ""
    25562556
    2557 #: src/core/Classes/Admin_Ajax.php:346 src/core/Classes/Author_Editor.php:1014
     2557#: src/core/Classes/Admin_Ajax.php:346 src/core/Classes/Author_Editor.php:1043
    25582558msgid "Mapped user is required."
    25592559msgstr ""
     
    26612661msgstr ""
    26622662
    2663 #: src/core/Classes/Author_Editor.php:878
     2663#: src/core/Classes/Author_Editor.php:907
    26642664msgid "No authors were updated"
    26652665msgstr ""
     
    28252825msgstr ""
    28262826
    2827 #: src/modules/multiple-authors/multiple-authors.php:4322
     2827#: src/modules/multiple-authors/multiple-authors.php:4320
    28282828msgid "Please click here and read this guide!"
    28292829msgstr ""
     
    28442844#: src/modules/byline-migration/byline-migration.php:148
    28452845#: src/modules/bylines-migration/bylines-migration.php:150
    2846 #: src/modules/multiple-authors/multiple-authors.php:3796
    2847 #: src/modules/multiple-authors/multiple-authors.php:3827
    2848 #: src/modules/multiple-authors/multiple-authors.php:3864
     2846#: 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
    28492849msgid "Please, wait..."
    28502850msgstr ""
     
    29592959msgstr ""
    29602960
    2961 #: src/modules/multiple-authors/multiple-authors.php:4394
     2961#: src/modules/multiple-authors/multiple-authors.php:4392
    29622962msgid ""
    29632963"PublishPress Authors needs a database update for Permissions integration."
     
    30863086
    30873087#: src/core/Classes/Author_Editor.php:119
    3088 #: src/core/Classes/Author_Editor.php:697
     3088#: src/core/Classes/Author_Editor.php:726
    30893089#: src/modules/author-list/author-list.php:977
    30903090msgid "Registered Author With User Account"
     
    32923292msgstr ""
    32933293
    3294 #: src/core/Classes/Author_Editor.php:742
     3294#: src/core/Classes/Author_Editor.php:771
    32953295msgid "Select Author Account"
    32963296msgstr ""
     
    35483548msgstr ""
    35493549
    3550 #: src/core/Classes/Admin_Ajax.php:334 src/core/Classes/Author_Editor.php:922
     3550#: src/core/Classes/Admin_Ajax.php:334 src/core/Classes/Author_Editor.php:951
    35513551msgid ""
    35523552"Sorry, this WordPress user is already mapped to another Author. By default, "
     
    35763576msgstr ""
    35773577
    3578 #: src/core/Classes/Author_Editor.php:805
    3579 #: src/modules/multiple-authors/multiple-authors.php:3792
     3578#: src/core/Classes/Author_Editor.php:834
     3579#: src/modules/multiple-authors/multiple-authors.php:3790
    35803580msgid "Sync author and user fields"
    35813581msgstr ""
    35823582
    3583 #: src/modules/multiple-authors/multiple-authors.php:3823
     3583#: src/modules/multiple-authors/multiple-authors.php:3821
    35843584msgid "Sync author and user URLs"
    35853585msgstr ""
     
    38633863msgstr ""
    38643864
    3865 #: src/core/Classes/Author_Editor.php:813
     3865#: src/core/Classes/Author_Editor.php:842
    38663866msgid "Update post count"
    38673867msgstr ""
    38683868
    3869 #: src/core/Classes/Author_Editor.php:881
     3869#: src/core/Classes/Author_Editor.php:910
    38703870msgid "Updated %d authors"
    38713871msgstr ""
    38723872
    3873 #: src/modules/multiple-authors/multiple-authors.php:3829
     3873#: src/modules/multiple-authors/multiple-authors.php:3827
    38743874msgid "Updated %d of %d authors..."
    38753875msgstr ""
    38763876
    3877 #: src/modules/multiple-authors/multiple-authors.php:3798
     3877#: src/modules/multiple-authors/multiple-authors.php:3796
    38783878msgid "Updated %d of %d posts..."
    38793879msgstr ""
    38803880
    3881 #: src/modules/multiple-authors/multiple-authors.php:3797
     3881#: src/modules/multiple-authors/multiple-authors.php:3795
    38823882msgid "Updating author field on posts..."
    38833883msgstr ""
    38843884
    3885 #: src/modules/multiple-authors/multiple-authors.php:3828
     3885#: src/modules/multiple-authors/multiple-authors.php:3826
    38863886msgid "Updating authors slug..."
    38873887msgstr ""
  • publishpress-authors/tags/4.7.2/publishpress-authors.php

    r3115415 r3169244  
    66 * Author:      PublishPress
    77 * Author URI:  https://publishpress.com
    8  * Version: 4.7.1
     8 * Version: 4.7.2
    99 * Text Domain: publishpress-authors
    1010 * Domain Path: /languages
  • publishpress-authors/tags/4.7.2/readme.txt

    r3115415 r3169244  
    77Requires at least: 5.5
    88Requires PHP: 7.2.5
    9 Tested up to: 6.5
    10 Stable tag: 4.7.1
     9Tested up to: 6.6
     10Stable tag: 4.7.2
    1111License: GPLv2 or later
    1212License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    246246
    247247== 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
    248254
    249255= [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  
    2525    var ppmaTab = 'ppma-tab-general';
    2626
    27     if (typeof ppmaSettings != 'undefined' && typeof ppmaSettings.tab != 'undefined') {
     27    if (typeof ppmaSettings != 'undefined' && typeof ppmaSettings.tab != 'undefined' && ppmaSettings.tab !== '') {
    2828       ppmaTab = ppmaSettings.tab;
    2929       $('#publishpress-authors-settings-tabs a[href="#' + ppmaTab + '"]').click();
  • publishpress-authors/tags/4.7.2/src/core/Classes/Author_Editor.php

    r3115415 r3169244  
    583583    {
    584584        if (empty($_POST['author-edit-nonce'])
     585            || !is_user_logged_in()
    585586            || !wp_verify_nonce(sanitize_key($_POST['author-edit-nonce']), 'author-edit')) {
    586587            return;
     
    597598                $user = false;
    598599                $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;
    602627        }
    603628
     
    607632            }
    608633            $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            }
    610639            update_term_meta($term_id, $key, $field_value);
    611640            if ($user_id) {
     
    808837        );
    809838        $bulk_actions['convert_into_guest_author'] = __(
    810             'Convert into Guest Author With User Account',
     839            'Convert to Registered Author With User Account',
    811840            'publishpress-authors'
    812841        );
  • publishpress-authors/tags/4.7.2/src/core/Classes/Objects/Author.php

    r3115415 r3169244  
    342342        $userId = get_term_meta($term_id, 'user_id', true);
    343343        $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
    344347        if ($userId && is_object($author) && isset($author->display_name)) {
    345348            $user_data = [
     
    350353            update_term_meta($term_id, 'user_id', $userId);
    351354            update_term_meta($term_id, 'user_id_' . $userId, $userId);
    352         } elseif (!empty($author->user_email)) {
     355        } else {
    353356            $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),
    355358                'display_name'  => $author->display_name,
    356                 'user_email'    => $author->user_email,
     359                'user_email'    => $new_author_email,
    357360                'user_pass'     => wp_generate_password(),
    358361                'role'          => 'ppma_guest_author',
    359362            ];
    360363            $userId = wp_insert_user($user_data);
    361            
     364
    362365            if (!is_wp_error($userId)) {
     366                update_term_meta($term_id, 'user_email', $new_author_email);
    363367                update_term_meta($term_id, 'user_id', $userId);
    364368                update_term_meta($term_id, 'user_id_' . $userId, $userId);
    365369            }
    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;
    370387    }
    371388
     
    747764        $urls = $this->get_custom_avatar_url($size);
    748765
     766        $imageId = attachment_url_to_postid($urls['url']);
     767
    749768        $class = [
    750769            'multiple_authors_guest_author_avatar',
     
    752771        ];
    753772
    754         $alt = $this->display_name;
     773        $alt = get_post_meta( $imageId, '_wp_attachment_image_alt', true );
    755774
    756775        // Build the HTML tag.
  • publishpress-authors/tags/4.7.2/src/core/Traits/Author_box.php

    r3087197 r3169244  
    176176                }
    177177            }
     178        }
     179
     180        if (empty($authorsList)) {
     181            return '';
    178182        }
    179183
  • publishpress-authors/tags/4.7.2/src/modules/multiple-authors/assets/js/coauthors-migration.jsx

    r3096813 r3169244  
    4646                data: {
    4747                    action: 'get_coauthors_migration_data',
    48                     nonce: this.props.nonce
     48                    nonce: self.props.nonce
    4949                },
    5050                success: function (response) {
     
    8383                data: {
    8484                    action: 'finish_coauthors_migration',
    85                     nonce: this.props.nonce
     85                    nonce: self.props.nonce
    8686                },
    8787                success: function (response) {
     
    109109            data: {
    110110                action: 'migrate_coauthors',
    111                 nonce: this.props.nonce,
    112                 chunkSize: this.state.chunkSize
     111                nonce: self.props.nonce,
     112                chunkSize: self.state.chunkSize
    113113            },
    114114            success: function (response) {
     
    195195            data: {
    196196                action: 'deactivate_coauthors_plus',
    197                 nonce: this.props.nonce
     197                nonce: self.props.nonce
    198198            },
    199199            success: function (response) {
  • publishpress-authors/tags/4.7.2/src/modules/multiple-authors/multiple-authors.php

    r3115415 r3169244  
    37623762                );
    37633763
    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                ]);
    37703768
    37713769                wp_enqueue_script(
  • publishpress-authors/trunk/defines.php

    r3115415 r3169244  
    1313
    1414if (!defined('PP_AUTHORS_LOADED')) {
    15     define('PP_AUTHORS_VERSION', '4.7.1');
     15    define('PP_AUTHORS_VERSION', '4.7.2');
    1616    define('PP_AUTHORS_FILE', 'publishpress-authors/publishpress-authors.php');
    1717    define('PP_AUTHORS_BASE_PATH', plugin_dir_path(__DIR__ . '/publishpress-authors.php'));
  • publishpress-authors/trunk/languages/publishpress-authors.pot

    r3115415 r3169244  
    33msgstr ""
    44"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"
    66"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    77"Last-Translator: Anderson Grudtner Martins <[email protected]>\n"
     
    521521msgstr ""
    522522
    523 #: src/core/Classes/Author_Editor.php:978
     523#: src/core/Classes/Author_Editor.php:1007
    524524msgid "An author email is required when creating new User Author."
    525525msgstr ""
    526526
    527 #: src/core/Classes/Author_Editor.php:948
    528 #: src/core/Classes/Author_Editor.php:966
     527#: src/core/Classes/Author_Editor.php:977
     528#: src/core/Classes/Author_Editor.php:995
    529529msgid "An author with the name provided already exists."
    530530msgstr ""
     
    819819msgstr ""
    820820
    821 #: src/core/Classes/Author_Editor.php:730
     821#: src/core/Classes/Author_Editor.php:759
    822822msgid "Author Email"
    823823msgstr ""
     
    983983#: src/core/Authors_Widget.php:138 src/core/Plugin.php:856
    984984#: src/core/Classes/Post_Editor.php:94 src/core/Classes/Post_Editor.php:206
    985 #: src/core/Traits/Author_box.php:189
     985#: src/core/Traits/Author_box.php:193
    986986#: src/modules/author-categories/author-categories.php:624
    987987#: src/modules/author-list/author-list.php:402
     
    13151315msgstr ""
    13161316
    1317 #: src/modules/multiple-authors/multiple-authors.php:4395
     1317#: src/modules/multiple-authors/multiple-authors.php:4393
    13181318msgid "Click to run the update now"
    13191319msgstr ""
     
    13341334#: src/modules/byline-migration/byline-migration.php:145
    13351335#: src/modules/bylines-migration/bylines-migration.php:147
    1336 #: src/modules/multiple-authors/multiple-authors.php:3861
     1336#: src/modules/multiple-authors/multiple-authors.php:3859
    13371337msgid "Collecting data for the migration..."
    13381338msgstr ""
    13391339
    1340 #: src/modules/multiple-authors/multiple-authors.php:3793
    1341 #: src/modules/multiple-authors/multiple-authors.php:3824
     1340#: src/modules/multiple-authors/multiple-authors.php:3791
     1341#: src/modules/multiple-authors/multiple-authors.php:3822
    13421342msgid "Collecting data..."
    13431343msgstr ""
     
    13701370msgstr ""
    13711371
    1372 #: src/core/Classes/Author_Editor.php:809
    1373 msgid "Convert into Guest Author With User Account"
     1372#: src/core/Classes/Author_Editor.php:838
     1373msgid "Convert to Registered Author With User Account"
    13741374msgstr ""
    13751375
     
    13971397msgstr ""
    13981398
    1399 #: src/modules/multiple-authors/multiple-authors.php:3866
     1399#: src/modules/multiple-authors/multiple-authors.php:3864
    14001400msgid "Copy Co-Authors Plus data"
    14011401msgstr ""
     
    14121412#: src/modules/byline-migration/byline-migration.php:149
    14131413#: src/modules/bylines-migration/bylines-migration.php:151
    1414 #: src/modules/multiple-authors/multiple-authors.php:3865
     1414#: src/modules/multiple-authors/multiple-authors.php:3863
    14151415msgid "Copying authors' data..."
    14161416msgstr ""
    14171417
    1418 #: src/core/Classes/Author_Editor.php:704
     1418#: src/core/Classes/Author_Editor.php:733
    14191419msgid ""
    14201420"Create an author profile and a linked user account. This account will be in "
     
    14231423msgstr ""
    14241424
    1425 #: src/core/Classes/Author_Editor.php:698
     1425#: src/core/Classes/Author_Editor.php:727
    14261426msgid ""
    14271427"Create an author profile for a current user account. You can select users "
     
    14301430msgstr ""
    14311431
    1432 #: src/core/Classes/Author_Editor.php:711
     1432#: src/core/Classes/Author_Editor.php:740
    14331433msgid ""
    14341434"Create an author profile with no linked user account. This option is "
     
    14741474msgstr ""
    14751475
    1476 #: src/modules/multiple-authors/multiple-authors.php:3863
     1476#: src/modules/multiple-authors/multiple-authors.php:3861
    14771477msgid "Creating missed post authors...."
    14781478msgstr ""
     
    15481548msgstr ""
    15491549
    1550 #: src/modules/multiple-authors/multiple-authors.php:3869
     1550#: src/modules/multiple-authors/multiple-authors.php:3867
    15511551msgid "Deactivate Co-Authors Plus"
    15521552msgstr ""
     
    15601560msgstr ""
    15611561
    1562 #: src/modules/multiple-authors/multiple-authors.php:3867
     1562#: src/modules/multiple-authors/multiple-authors.php:3865
    15631563msgid "Deactivating Co-uthors Plus..."
    15641564msgstr ""
     
    16951695msgstr ""
    16961696
    1697 #: src/modules/multiple-authors/multiple-authors.php:4327
    1698 #: src/modules/multiple-authors/multiple-authors.php:4401
     1697#: src/modules/multiple-authors/multiple-authors.php:4325
     1698#: src/modules/multiple-authors/multiple-authors.php:4399
    16991699msgid "Dismiss"
    17001700msgstr ""
     
    17911791msgstr ""
    17921792
    1793 #: src/modules/multiple-authors/multiple-authors.php:3826
     1793#: src/modules/multiple-authors/multiple-authors.php:3824
    17941794msgid "Done! %d authors were updated."
    17951795msgstr ""
    17961796
    1797 #: src/modules/multiple-authors/multiple-authors.php:3795
     1797#: src/modules/multiple-authors/multiple-authors.php:3793
    17981798msgid "Done! %d posts were updated."
    17991799msgstr ""
     
    18151815msgstr ""
    18161816
    1817 #: src/modules/multiple-authors/multiple-authors.php:3870
     1817#: src/modules/multiple-authors/multiple-authors.php:3868
    18181818msgid "Done! Co-Authors Plus data was copied."
    18191819msgstr ""
    18201820
    1821 #: src/modules/multiple-authors/multiple-authors.php:3868
     1821#: src/modules/multiple-authors/multiple-authors.php:3866
    18221822msgid "Done! Co-Authors Plus is deactivated."
    18231823msgstr ""
     
    20022002#: src/modules/byline-migration/byline-migration.php:146
    20032003#: src/modules/bylines-migration/bylines-migration.php:148
    2004 #: src/modules/multiple-authors/multiple-authors.php:3862
     2004#: src/modules/multiple-authors/multiple-authors.php:3860
    20052005msgid "Error: "
    20062006msgstr ""
     
    21042104msgstr ""
    21052105
    2106 #: src/modules/multiple-authors/multiple-authors.php:3794
    2107 #: src/modules/multiple-authors/multiple-authors.php:3825
     2106#: src/modules/multiple-authors/multiple-authors.php:3792
     2107#: src/modules/multiple-authors/multiple-authors.php:3823
    21082108msgid "Finishing the process..."
    21092109msgstr ""
     
    21882188msgstr ""
    21892189
    2190 #: src/modules/multiple-authors/multiple-authors.php:4786
     2190#: src/modules/multiple-authors/multiple-authors.php:4784
    21912191msgid "Guest Author cannot login on the site."
    21922192msgstr ""
    21932193
    21942194#: src/core/Classes/Author_Editor.php:121
    2195 #: src/core/Classes/Author_Editor.php:710
     2195#: src/core/Classes/Author_Editor.php:739
    21962196#: src/modules/author-list/author-list.php:979
    21972197msgid "Guest Author With No User Account"
     
    21992199
    22002200#: src/core/Classes/Author_Editor.php:117
    2201 #: src/core/Classes/Author_Editor.php:703
     2201#: src/core/Classes/Author_Editor.php:732
    22022202#: src/modules/author-list/author-list.php:978
    22032203msgid "Guest Author With User Account"
     
    24252425msgstr ""
    24262426
    2427 #: src/modules/multiple-authors/multiple-authors.php:4321
     2427#: src/modules/multiple-authors/multiple-authors.php:4319
    24282428msgid "It looks like you have Co-Authors Plus installed."
    24292429msgstr ""
     
    25552555msgstr ""
    25562556
    2557 #: src/core/Classes/Admin_Ajax.php:346 src/core/Classes/Author_Editor.php:1014
     2557#: src/core/Classes/Admin_Ajax.php:346 src/core/Classes/Author_Editor.php:1043
    25582558msgid "Mapped user is required."
    25592559msgstr ""
     
    26612661msgstr ""
    26622662
    2663 #: src/core/Classes/Author_Editor.php:878
     2663#: src/core/Classes/Author_Editor.php:907
    26642664msgid "No authors were updated"
    26652665msgstr ""
     
    28252825msgstr ""
    28262826
    2827 #: src/modules/multiple-authors/multiple-authors.php:4322
     2827#: src/modules/multiple-authors/multiple-authors.php:4320
    28282828msgid "Please click here and read this guide!"
    28292829msgstr ""
     
    28442844#: src/modules/byline-migration/byline-migration.php:148
    28452845#: src/modules/bylines-migration/bylines-migration.php:150
    2846 #: src/modules/multiple-authors/multiple-authors.php:3796
    2847 #: src/modules/multiple-authors/multiple-authors.php:3827
    2848 #: src/modules/multiple-authors/multiple-authors.php:3864
     2846#: 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
    28492849msgid "Please, wait..."
    28502850msgstr ""
     
    29592959msgstr ""
    29602960
    2961 #: src/modules/multiple-authors/multiple-authors.php:4394
     2961#: src/modules/multiple-authors/multiple-authors.php:4392
    29622962msgid ""
    29632963"PublishPress Authors needs a database update for Permissions integration."
     
    30863086
    30873087#: src/core/Classes/Author_Editor.php:119
    3088 #: src/core/Classes/Author_Editor.php:697
     3088#: src/core/Classes/Author_Editor.php:726
    30893089#: src/modules/author-list/author-list.php:977
    30903090msgid "Registered Author With User Account"
     
    32923292msgstr ""
    32933293
    3294 #: src/core/Classes/Author_Editor.php:742
     3294#: src/core/Classes/Author_Editor.php:771
    32953295msgid "Select Author Account"
    32963296msgstr ""
     
    35483548msgstr ""
    35493549
    3550 #: src/core/Classes/Admin_Ajax.php:334 src/core/Classes/Author_Editor.php:922
     3550#: src/core/Classes/Admin_Ajax.php:334 src/core/Classes/Author_Editor.php:951
    35513551msgid ""
    35523552"Sorry, this WordPress user is already mapped to another Author. By default, "
     
    35763576msgstr ""
    35773577
    3578 #: src/core/Classes/Author_Editor.php:805
    3579 #: src/modules/multiple-authors/multiple-authors.php:3792
     3578#: src/core/Classes/Author_Editor.php:834
     3579#: src/modules/multiple-authors/multiple-authors.php:3790
    35803580msgid "Sync author and user fields"
    35813581msgstr ""
    35823582
    3583 #: src/modules/multiple-authors/multiple-authors.php:3823
     3583#: src/modules/multiple-authors/multiple-authors.php:3821
    35843584msgid "Sync author and user URLs"
    35853585msgstr ""
     
    38633863msgstr ""
    38643864
    3865 #: src/core/Classes/Author_Editor.php:813
     3865#: src/core/Classes/Author_Editor.php:842
    38663866msgid "Update post count"
    38673867msgstr ""
    38683868
    3869 #: src/core/Classes/Author_Editor.php:881
     3869#: src/core/Classes/Author_Editor.php:910
    38703870msgid "Updated %d authors"
    38713871msgstr ""
    38723872
    3873 #: src/modules/multiple-authors/multiple-authors.php:3829
     3873#: src/modules/multiple-authors/multiple-authors.php:3827
    38743874msgid "Updated %d of %d authors..."
    38753875msgstr ""
    38763876
    3877 #: src/modules/multiple-authors/multiple-authors.php:3798
     3877#: src/modules/multiple-authors/multiple-authors.php:3796
    38783878msgid "Updated %d of %d posts..."
    38793879msgstr ""
    38803880
    3881 #: src/modules/multiple-authors/multiple-authors.php:3797
     3881#: src/modules/multiple-authors/multiple-authors.php:3795
    38823882msgid "Updating author field on posts..."
    38833883msgstr ""
    38843884
    3885 #: src/modules/multiple-authors/multiple-authors.php:3828
     3885#: src/modules/multiple-authors/multiple-authors.php:3826
    38863886msgid "Updating authors slug..."
    38873887msgstr ""
  • publishpress-authors/trunk/publishpress-authors.php

    r3115415 r3169244  
    66 * Author:      PublishPress
    77 * Author URI:  https://publishpress.com
    8  * Version: 4.7.1
     8 * Version: 4.7.2
    99 * Text Domain: publishpress-authors
    1010 * Domain Path: /languages
  • publishpress-authors/trunk/readme.txt

    r3115415 r3169244  
    77Requires at least: 5.5
    88Requires PHP: 7.2.5
    9 Tested up to: 6.5
    10 Stable tag: 4.7.1
     9Tested up to: 6.6
     10Stable tag: 4.7.2
    1111License: GPLv2 or later
    1212License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    246246
    247247== 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
    248254
    249255= [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  
    2525    var ppmaTab = 'ppma-tab-general';
    2626
    27     if (typeof ppmaSettings != 'undefined' && typeof ppmaSettings.tab != 'undefined') {
     27    if (typeof ppmaSettings != 'undefined' && typeof ppmaSettings.tab != 'undefined' && ppmaSettings.tab !== '') {
    2828       ppmaTab = ppmaSettings.tab;
    2929       $('#publishpress-authors-settings-tabs a[href="#' + ppmaTab + '"]').click();
  • publishpress-authors/trunk/src/core/Classes/Author_Editor.php

    r3115415 r3169244  
    583583    {
    584584        if (empty($_POST['author-edit-nonce'])
     585            || !is_user_logged_in()
    585586            || !wp_verify_nonce(sanitize_key($_POST['author-edit-nonce']), 'author-edit')) {
    586587            return;
     
    597598                $user = false;
    598599                $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;
    602627        }
    603628
     
    607632            }
    608633            $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            }
    610639            update_term_meta($term_id, $key, $field_value);
    611640            if ($user_id) {
     
    808837        );
    809838        $bulk_actions['convert_into_guest_author'] = __(
    810             'Convert into Guest Author With User Account',
     839            'Convert to Registered Author With User Account',
    811840            'publishpress-authors'
    812841        );
  • publishpress-authors/trunk/src/core/Classes/Objects/Author.php

    r3115415 r3169244  
    342342        $userId = get_term_meta($term_id, 'user_id', true);
    343343        $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
    344347        if ($userId && is_object($author) && isset($author->display_name)) {
    345348            $user_data = [
     
    350353            update_term_meta($term_id, 'user_id', $userId);
    351354            update_term_meta($term_id, 'user_id_' . $userId, $userId);
    352         } elseif (!empty($author->user_email)) {
     355        } else {
    353356            $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),
    355358                'display_name'  => $author->display_name,
    356                 'user_email'    => $author->user_email,
     359                'user_email'    => $new_author_email,
    357360                'user_pass'     => wp_generate_password(),
    358361                'role'          => 'ppma_guest_author',
    359362            ];
    360363            $userId = wp_insert_user($user_data);
    361            
     364
    362365            if (!is_wp_error($userId)) {
     366                update_term_meta($term_id, 'user_email', $new_author_email);
    363367                update_term_meta($term_id, 'user_id', $userId);
    364368                update_term_meta($term_id, 'user_id_' . $userId, $userId);
    365369            }
    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;
    370387    }
    371388
     
    747764        $urls = $this->get_custom_avatar_url($size);
    748765
     766        $imageId = attachment_url_to_postid($urls['url']);
     767
    749768        $class = [
    750769            'multiple_authors_guest_author_avatar',
     
    752771        ];
    753772
    754         $alt = $this->display_name;
     773        $alt = get_post_meta( $imageId, '_wp_attachment_image_alt', true );
    755774
    756775        // Build the HTML tag.
  • publishpress-authors/trunk/src/core/Traits/Author_box.php

    r3087197 r3169244  
    176176                }
    177177            }
     178        }
     179
     180        if (empty($authorsList)) {
     181            return '';
    178182        }
    179183
  • publishpress-authors/trunk/src/modules/multiple-authors/assets/js/coauthors-migration.jsx

    r3096813 r3169244  
    4646                data: {
    4747                    action: 'get_coauthors_migration_data',
    48                     nonce: this.props.nonce
     48                    nonce: self.props.nonce
    4949                },
    5050                success: function (response) {
     
    8383                data: {
    8484                    action: 'finish_coauthors_migration',
    85                     nonce: this.props.nonce
     85                    nonce: self.props.nonce
    8686                },
    8787                success: function (response) {
     
    109109            data: {
    110110                action: 'migrate_coauthors',
    111                 nonce: this.props.nonce,
    112                 chunkSize: this.state.chunkSize
     111                nonce: self.props.nonce,
     112                chunkSize: self.state.chunkSize
    113113            },
    114114            success: function (response) {
     
    195195            data: {
    196196                action: 'deactivate_coauthors_plus',
    197                 nonce: this.props.nonce
     197                nonce: self.props.nonce
    198198            },
    199199            success: function (response) {
  • publishpress-authors/trunk/src/modules/multiple-authors/multiple-authors.php

    r3115415 r3169244  
    37623762                );
    37633763
    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                ]);
    37703768
    37713769                wp_enqueue_script(
Note: See TracChangeset for help on using the changeset viewer.