From 5c07ab8ae8fcdd0b9e5586f30370a69c4227473a Mon Sep 17 00:00:00 2001 From: Sebastien Dumont Date: Tue, 20 Oct 2015 00:07:42 +0200 Subject: [PATCH 1/5] Update for version 1.4.3 --- assets/css/admin/activation.css | 34 -- assets/css/admin/auto-load-next-post.css | 27 +- assets/css/admin/auto-load-next-post.min.css | 2 +- assets/css/{ => libs}/chosen.css | 16 +- assets/css/{ => libs}/chosen.min.css | 0 assets/js/frontend/auto-load-next-post.js | 127 ++++-- assets/js/frontend/auto-load-next-post.min.js | 2 +- assets/js/{ => libs}/chosen/chosen.jquery.js | 0 .../js/{ => libs}/chosen/chosen.jquery.min.js | 0 .../{ => libs}/jquery-tiptip/jquery.tipTip.js | 0 .../jquery-tiptip/jquery.tipTip.min.js | 0 .../js/{frontend => libs}/jquery.history.js | 0 assets/js/{frontend => libs}/scrollspy.js | 0 assets/js/{frontend => libs}/scrollspy.min.js | 0 auto-load-next-post.php | 408 +++--------------- .../auto-load-next-post-admin-functions.php | 27 -- ...s-auto-load-next-post-admin-activation.php | 58 +++ .../class-auto-load-next-post-admin-help.php | 31 +- .../class-auto-load-next-post-admin-menus.php | 8 +- ...lass-auto-load-next-post-admin-notices.php | 41 +- ...ass-auto-load-next-post-admin-settings.php | 61 ++- .../admin/class-auto-load-next-post-admin.php | 140 +++--- .../class-auto-load-next-post-install.php | 4 +- ...s-auto-load-next-post-settings-general.php | 81 ++-- ...lass-auto-load-next-post-settings-page.php | 7 +- ...s-auto-load-next-post-settings-support.php | 92 ++++ includes/admin/views/html-admin-settings.php | 14 +- .../views/html-notice-requirement-wp.php | 10 + .../admin/views/html-notice-theme-support.php | 4 +- includes/admin/wp-update-php/WPUpdatePhp.php | 50 +++ ...o-load-next-post-conditional-functions.php | 25 ++ .../auto-load-next-post-core-functions.php | 19 +- languages/auto-load-next-post-de_DE.mo | Bin 0 -> 5222 bytes languages/auto-load-next-post-de_DE.po | 277 ++++++++++++ languages/auto-load-next-post-fr_FR.mo | Bin 6368 -> 8025 bytes languages/auto-load-next-post-fr_FR.po | 206 +++++---- languages/auto-load-next-post-it_IT.mo | Bin 0 -> 4728 bytes languages/auto-load-next-post-it_IT.po | 276 ++++++++++++ languages/auto-load-next-post-ro_RO.mo | Bin 6350 -> 5229 bytes languages/auto-load-next-post-ro_RO.po | 203 +++++---- languages/auto-load-next-post.pot | 210 +++++---- readme.txt | 112 +++-- template/content-partial.php | 25 +- 43 files changed, 1672 insertions(+), 925 deletions(-) delete mode 100644 assets/css/admin/activation.css rename assets/css/{ => libs}/chosen.css (95%) rename assets/css/{ => libs}/chosen.min.css (100%) rename assets/js/{ => libs}/chosen/chosen.jquery.js (100%) rename assets/js/{ => libs}/chosen/chosen.jquery.min.js (100%) rename assets/js/{ => libs}/jquery-tiptip/jquery.tipTip.js (100%) rename assets/js/{ => libs}/jquery-tiptip/jquery.tipTip.min.js (100%) rename assets/js/{frontend => libs}/jquery.history.js (100%) rename assets/js/{frontend => libs}/scrollspy.js (100%) rename assets/js/{frontend => libs}/scrollspy.min.js (100%) delete mode 100644 includes/admin/auto-load-next-post-admin-functions.php create mode 100644 includes/admin/class-auto-load-next-post-admin-activation.php create mode 100644 includes/admin/settings/class-auto-load-next-post-settings-support.php create mode 100644 includes/admin/views/html-notice-requirement-wp.php create mode 100644 includes/admin/wp-update-php/WPUpdatePhp.php create mode 100644 languages/auto-load-next-post-de_DE.mo create mode 100644 languages/auto-load-next-post-de_DE.po create mode 100644 languages/auto-load-next-post-it_IT.mo create mode 100644 languages/auto-load-next-post-it_IT.po diff --git a/assets/css/admin/activation.css b/assets/css/admin/activation.css deleted file mode 100644 index 12f7d7a..0000000 --- a/assets/css/admin/activation.css +++ /dev/null @@ -1,34 +0,0 @@ -.auto-load-next-post-message { - position: relative; - border-left-color: #EC8642 !important; - overflow: hidden; -} - -.auto-load-next-post-message a.button-primary, -p.auto-load-next-post-actions a.button-primary { - background: #EC8642; - border-color: #EB6D19; - -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.15); - box-shadow: inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.15); - color: #fff; - text-decoration: none; -} - -.auto-load-next-post-message a.button-primary:hover, -p.auto-load-next-post-actions a.button-primary:hover { - background: #EB6D19; - border-color: #EB6D19; - -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.15); - box-shadow: inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.15); -} - -.auto-load-next-post-message a.button-primary:active, -p.auto-load-next-post-actions a.button-primary:active { - background: #fac75a; - border-color: #EC8642; -} - -.auto-load-next-post-message a.docs, -p.auto-load-next-post-actions a.docs { - opacity: .7; -} \ No newline at end of file diff --git a/assets/css/admin/auto-load-next-post.css b/assets/css/admin/auto-load-next-post.css index 436fa77..1328a68 100644 --- a/assets/css/admin/auto-load-next-post.css +++ b/assets/css/admin/auto-load-next-post.css @@ -1,3 +1,6 @@ +/** + * CSS for Auto Load Next Post settings page. + */ .clear { clear: both; } @@ -37,11 +40,25 @@ } .wrap.auto-load-next-post input[type="button"].button-primary:active, .wrap.auto-load-next-post input[type="submit"].button-primary:active, +.wrap.auto-load-next-post input[type="button"].button-primary:focus, +.wrap.auto-load-next-post input[type="submit"].button-primary:focus, .auto-load-next-post-message a.button-primary:active, .auto-load-next-post-actions a.button-primary:active, -.help-tab-content a.button-primary:active{ +.auto-load-next-post-message a.button-primary:focus, +.auto-load-next-post-actions a.button-primary:focus, +.help-tab-content a.button-primary:active, +.help-tab-content a.button-primary:focus{ background: #fac75a; border-color: #EC8642; + color: #ffffff; +} +.wrap.auto-load-next-post input[type="button"].button-primary:focus, +.wrap.auto-load-next-post input[type="submit"].button-primary:focus, +.auto-load-next-post-message a.button-primary:focus, +.auto-load-next-post-actions a.button-primary:focus, +.help-tab-content a.button-primary:focus{ + -webkit-box-shadow: inset 0 1px 0 rgb(247, 216, 66), 0 0 0 1px rgb(228, 175, 56), 0 0 4px 1px rgba(30, 140, 190, .8); + box-shadow: inset 0 1px 0 rgb(247, 216, 66), 0 0 0 1px rgb(228, 175, 56), 0 0 4px 1px rgba(30, 140, 190, .8); } .auto-load-next-post-message a.skip, .auto-load-next-post-message a.docs, @@ -57,6 +74,11 @@ -webkit-transition-duration: 0.4s; transition-duration: 0.4s; } +.wrap.auto-load-next-post.support input[type="button"].button-primary, +.wrap.auto-load-next-post.support input[type="submit"].button-primary, +.auto-load-next-post-message.support a.button-primary{ + display:none; +} h2.nav-tab-wrapper{padding-left:0px !important;} h2 .nav-tab:first-child{margin-left:10px;} .wrap.auto-load-next-post-div.updated, .wrap.auto-load-next-post-div.error{margin-top:10px} @@ -116,6 +138,7 @@ img.help_tip{ } .auto-load-next-post table.form-table fieldset{margin-top:4px} .auto-load-next-post table.form-table fieldset img.help_tip{margin:-3px 0 0 5px} + /** * CSS for TipTip * @@ -196,4 +219,4 @@ img.help_tip{ top:-3px; left:50%; margin:-1em 0 0 -3px; -} \ No newline at end of file +} diff --git a/assets/css/admin/auto-load-next-post.min.css b/assets/css/admin/auto-load-next-post.min.css index ce6b127..b86bfb2 100644 --- a/assets/css/admin/auto-load-next-post.min.css +++ b/assets/css/admin/auto-load-next-post.min.css @@ -1 +1 @@ -.clear{clear:both}.nobr{white-space:nowrap}#wpfooter .wrap{display:block;margin:3px 0!important}.auto-load-next-post-message{position:relative;border-left-color:#EC8642!important;overflow:hidden}.wrap.auto-load-next-post input[type="button"].button-primary,.wrap.auto-load-next-post input[type="submit"].button-primary,.auto-load-next-post-message a.button-primary,.auto-load-next-post-actions a.button-primary,.help-tab-content a.button-primary{background:#EC8642;border-color:#EB6D19;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.15);color:#fff;text-decoration:none!important}.wrap.auto-load-next-post input[type="button"].button-primary:hover,.wrap.auto-load-next-post input[type="submit"].button-primary:hover,.auto-load-next-post-message a.button-primary:hover,.auto-load-next-post-actions a.button-primary:hover,.help-tab-content a.button-primary:hover{background:#EB6D19;border-color:#EB3B19;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.15)}.wrap.auto-load-next-post input[type="button"].button-primary:active,.wrap.auto-load-next-post input[type="submit"].button-primary:active,.auto-load-next-post-message a.button-primary:active,.auto-load-next-post-actions a.button-primary:active,.help-tab-content a.button-primary:active{background:#fac75a;border-color:#EC8642}.auto-load-next-post-message a.skip,.auto-load-next-post-message a.docs,.auto-load-next-post-actions a.docs{opacity:.7;-webkit-transition-duration:.4s;transition-duration:.4s}.auto-load-next-post-message a.skip:hover,.auto-load-next-post-message a.docs:hover,.auto-load-next-post-actions a.docs:hover{opacity:1;-webkit-transition-duration:.4s;transition-duration:.4s}h2.nav-tab-wrapper{padding-left:0!important}h2 .nav-tab:first-child{margin-left:10px}.wrap.auto-load-next-post-div.updated,.wrap.auto-load-next-post-div.error{margin-top:10px}.wrap.auto-load-next-post.auto-load-next-post-status .submit.debug-report{margin:0;padding:0}.button.auto-load-next-post-reload{display:block;text-indent:-9999px;position:relative;height:1em;width:1em;padding:0;-webkit-border-radius:100%;border-radius:100%;height:24px;width:24px!important;display:inline-block}.button.auto-load-next-post-reload:after{speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;line-height:22px}img.help_tip{vertical-align:middle;margin:0 0 0 9px}.postbox img.help_tip{margin-top:-4px}.auto-load-next-post table.form-table img.help_tip{padding:0;margin:-4px 0 0 5px;vertical-align:middle;cursor:help;line-height:1}.auto-load-next-post table.form-table span.help_tip{cursor:help;color:#2ea2cc}.auto-load-next-post table.form-table th img.help_tip{margin:4px -10px 0 0;float:right}.auto-load-next-post table.form-table fieldset{margin-top:4px}.auto-load-next-post table.form-table fieldset img.help_tip{margin:-3px 0 0 5px}#tiptip_holder{display:none;position:absolute;top:0;left:0;z-index:99999}#tiptip_holder.tip_top{padding-bottom:5px}#tiptip_holder.tip_top #tiptip_arrow_inner{margin-top:-7px;margin-left:-6px;border-top-color:#fac75a}#tiptip_holder.tip_bottom{padding-top:5px}#tiptip_holder.tip_bottom #tiptip_arrow_inner{margin-top:-5px;margin-left:-6px;border-bottom-color:#fac75a}#tiptip_holder.tip_right{padding-left:5px}#tiptip_holder.tip_right #tiptip_arrow_inner{margin-top:-6px;margin-left:-5px;border-right-color:#fac75a}#tiptip_holder.tip_left{padding-right:5px}#tiptip_holder.tip_left #tiptip_arrow_inner{margin-top:-6px;margin-left:-7px;border-left-color:#fac75a}#tiptip_content,.auto_load_next_post_error_tip{font-size:11px;color:#333;padding:.5em;background:#fac75a;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:1px 1px 3px rgba(0,0,0,.1);-moz-box-shadow:1px 1px 3px rgba(0,0,0,.1);box-shadow:1px 1px 3px rgba(0,0,0,.1);text-align:center}#tiptip_content code,.auto_load_next_post_error_tip code{background:#888;padding:1px}#tiptip_arrow,#tiptip_arrow_inner{position:absolute;border-color:transparent;border-style:solid;border-width:6px;height:0;width:0}.auto_load_next_post_error_tip{background:#d82223;max-width:20em;white-space:normal;position:absolute;margin:1.5em 1px 0 -1em;z-index:9999999}.auto_load_next_post_error_tip:after{content:"";display:block;border:8px solid #d82223;border-right-color:transparent;border-left-color:transparent;border-top-color:transparent;position:absolute;top:-3px;left:50%;margin:-1em 0 0 -3px} \ No newline at end of file +.clear{clear:both}.nobr{white-space:nowrap}#wpfooter .wrap{display:block;margin:3px 0!important}.auto-load-next-post-message{position:relative;border-left-color:#EC8642!important;overflow:hidden}.wrap.auto-load-next-post input[type="button"].button-primary,.wrap.auto-load-next-post input[type="submit"].button-primary,.auto-load-next-post-message a.button-primary,.auto-load-next-post-actions a.button-primary,.help-tab-content a.button-primary{background:#EC8642;border-color:#EB6D19;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.15);color:#fff;text-decoration:none!important}.wrap.auto-load-next-post input[type="button"].button-primary:hover,.wrap.auto-load-next-post input[type="submit"].button-primary:hover,.auto-load-next-post-message a.button-primary:hover,.auto-load-next-post-actions a.button-primary:hover,.help-tab-content a.button-primary:hover{background:#EB6D19;border-color:#EB3B19;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 0 rgba(0,0,0,.15)}.wrap.auto-load-next-post input[type="button"].button-primary:active,.wrap.auto-load-next-post input[type="submit"].button-primary:active,.wrap.auto-load-next-post input[type="button"].button-primary:focus,.wrap.auto-load-next-post input[type="submit"].button-primary:focus,.auto-load-next-post-message a.button-primary:active,.auto-load-next-post-actions a.button-primary:active,.auto-load-next-post-message a.button-primary:focus,.auto-load-next-post-actions a.button-primary:focus,.help-tab-content a.button-primary:active,.help-tab-content a.button-primary:focus{background:#fac75a;border-color:#EC8642;color:#fff}.wrap.auto-load-next-post input[type="button"].button-primary:focus,.wrap.auto-load-next-post input[type="submit"].button-primary:focus,.auto-load-next-post-message a.button-primary:focus,.auto-load-next-post-actions a.button-primary:focus,.help-tab-content a.button-primary:focus{-webkit-box-shadow:inset 0 1px 0 #f7d842 0 0 0 1px #e4af38 0 0 4px 1px rgba(30,140,190,.8);box-shadow:inset 0 1px 0 #f7d842 0 0 0 1px #e4af38 0 0 4px 1px rgba(30,140,190,.8)}.auto-load-next-post-message a.skip,.auto-load-next-post-message a.docs,.auto-load-next-post-actions a.docs{opacity:.7;-webkit-transition-duration:.4s;transition-duration:.4s}.auto-load-next-post-message a.skip:hover,.auto-load-next-post-message a.docs:hover,.auto-load-next-post-actions a.docs:hover{opacity:1;-webkit-transition-duration:.4s;transition-duration:.4s}.wrap.auto-load-next-post.support input[type="button"].button-primary,.wrap.auto-load-next-post.support input[type="submit"].button-primary,.auto-load-next-post-message.support a.button-primary{display:none}h2.nav-tab-wrapper{padding-left:0!important}h2 .nav-tab:first-child{margin-left:10px}.wrap.auto-load-next-post-div.updated,.wrap.auto-load-next-post-div.error{margin-top:10px}.wrap.auto-load-next-post.auto-load-next-post-status .submit.debug-report{margin:0;padding:0}.button.auto-load-next-post-reload{display:block;text-indent:-9999px;position:relative;height:1em;width:1em;padding:0;-webkit-border-radius:100%;border-radius:100%;height:24px;width:24px!important;display:inline-block}.button.auto-load-next-post-reload:after{speak:none;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;margin:0;text-indent:0;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;line-height:22px}img.help_tip{vertical-align:middle;margin:0 0 0 9px}.postbox img.help_tip{margin-top:-4px}.auto-load-next-post table.form-table img.help_tip{padding:0;margin:-4px 0 0 5px;vertical-align:middle;cursor:help;line-height:1}.auto-load-next-post table.form-table span.help_tip{cursor:help;color:#2ea2cc}.auto-load-next-post table.form-table th img.help_tip{margin:4px -10px 0 0;float:right}.auto-load-next-post table.form-table fieldset{margin-top:4px}.auto-load-next-post table.form-table fieldset img.help_tip{margin:-3px 0 0 5px}#tiptip_holder{display:none;position:absolute;top:0;left:0;z-index:99999}#tiptip_holder.tip_top{padding-bottom:5px}#tiptip_holder.tip_top #tiptip_arrow_inner{margin-top:-7px;margin-left:-6px;border-top-color:#fac75a}#tiptip_holder.tip_bottom{padding-top:5px}#tiptip_holder.tip_bottom #tiptip_arrow_inner{margin-top:-5px;margin-left:-6px;border-bottom-color:#fac75a}#tiptip_holder.tip_right{padding-left:5px}#tiptip_holder.tip_right #tiptip_arrow_inner{margin-top:-6px;margin-left:-5px;border-right-color:#fac75a}#tiptip_holder.tip_left{padding-right:5px}#tiptip_holder.tip_left #tiptip_arrow_inner{margin-top:-6px;margin-left:-7px;border-left-color:#fac75a}#tiptip_content,.auto_load_next_post_error_tip{font-size:11px;color:#333;padding:.5em;background:#fac75a;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:1px 1px 3px rgba(0,0,0,.1);-moz-box-shadow:1px 1px 3px rgba(0,0,0,.1);box-shadow:1px 1px 3px rgba(0,0,0,.1);text-align:center}#tiptip_content code,.auto_load_next_post_error_tip code{background:#888;padding:1px}#tiptip_arrow,#tiptip_arrow_inner{position:absolute;border-color:transparent;border-style:solid;border-width:6px;height:0;width:0}.auto_load_next_post_error_tip{background:#d82223;max-width:20em;white-space:normal;position:absolute;margin:1.5em 1px 0 -1em;z-index:9999999}.auto_load_next_post_error_tip:after{content:"";display:block;border:8px solid #d82223;border-right-color:transparent;border-left-color:transparent;border-top-color:transparent;position:absolute;top:-3px;left:50%;margin:-1em 0 0 -3px} diff --git a/assets/css/chosen.css b/assets/css/libs/chosen.css similarity index 95% rename from assets/css/chosen.css rename to assets/css/libs/chosen.css index 794832b..68644aa 100644 --- a/assets/css/chosen.css +++ b/assets/css/libs/chosen.css @@ -101,7 +101,7 @@ This file is generated by `grunt build`, do not edit it by hand. display: block; width: 12px; height: 12px; - background: url('../images/chosen-sprite.png') -42px 1px no-repeat; + background: url('../../images/chosen-sprite.png') -42px 1px no-repeat; font-size: 1px; } .chosen-container-single .chosen-single abbr:hover { @@ -122,7 +122,7 @@ This file is generated by `grunt build`, do not edit it by hand. display: block; width: 100%; height: 100%; - background: url('../images/chosen-sprite.png') no-repeat 0px 2px; + background: url('../../images/chosen-sprite.png') no-repeat 0px 2px; } .chosen-container-single .chosen-search { position: relative; @@ -138,8 +138,8 @@ This file is generated by `grunt build`, do not edit it by hand. height: auto; outline: 0; border: 1px solid #aaa; - background: white url('../images/chosen-sprite.png') no-repeat 100% -20px; - background: url('../images/chosen-sprite.png') no-repeat 100% -20px; + background: white url('../../images/chosen-sprite.png') no-repeat 100% -20px; + background: url('../../images/chosen-sprite.png') no-repeat 100% -20px; font-size: 1em; font-family: sans-serif; line-height: normal; @@ -285,7 +285,7 @@ This file is generated by `grunt build`, do not edit it by hand. display: block; width: 12px; height: 12px; - background: url('../images/chosen-sprite.png') -42px 1px no-repeat; + background: url('../../images/chosen-sprite.png') -42px 1px no-repeat; font-size: 1px; } .chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover { @@ -421,8 +421,8 @@ This file is generated by `grunt build`, do not edit it by hand. } .chosen-rtl .chosen-search input[type="text"] { padding: 4px 5px 4px 20px; - background: white url('../images/chosen-sprite.png') no-repeat -30px -20px; - background: url('../images/chosen-sprite.png') no-repeat -30px -20px; + background: white url('../../images/chosen-sprite.png') no-repeat -30px -20px; + background: url('../../images/chosen-sprite.png') no-repeat -30px -20px; direction: rtl; } .chosen-rtl.chosen-container-single .chosen-single div b { @@ -442,7 +442,7 @@ This file is generated by `grunt build`, do not edit it by hand. .chosen-container-multi .chosen-choices .search-choice .search-choice-close, .chosen-container .chosen-results-scroll-down span, .chosen-container .chosen-results-scroll-up span { - background-image: url('../images/chosen-sprite@2x.png') !important; + background-image: url('../../images/chosen-sprite@2x.png') !important; background-size: 52px 37px !important; background-repeat: no-repeat !important; } diff --git a/assets/css/chosen.min.css b/assets/css/libs/chosen.min.css similarity index 100% rename from assets/css/chosen.min.css rename to assets/css/libs/chosen.min.css diff --git a/assets/js/frontend/auto-load-next-post.js b/assets/js/frontend/auto-load-next-post.js index 244e516..4cf0ee5 100644 --- a/assets/js/frontend/auto-load-next-post.js +++ b/assets/js/frontend/auto-load-next-post.js @@ -1,40 +1,54 @@ // Variables var content_container = auto_load_next_post_params.alnp_content_container; +var post_title_selector = auto_load_next_post_params.alnp_title_selector; var nav_container = auto_load_next_post_params.alnp_navigation_container; var comments_container = auto_load_next_post_params.alnp_comments_container; -var post_title_selector = auto_load_next_post_params.alnp_title_selector; +var remove_comments = auto_load_next_post_params.alnp_remove_comments; +var track_pageviews = auto_load_next_post_params.alnp_google_analytics; var curr_url = window.location.href; jQuery.noConflict(); -jQuery( document ).ready(function() { +jQuery( document ).ready( function() { // Don't do this if looking for comments if ( window.location.href.indexOf( '#comments' ) > -1 ) { return; } - // It's up to you if you want to hide the comments. If the anwser is yes then the comments will be gone. - console.log( 'Remove Comments: ' + auto_load_next_post_params.alnp_remove_comments ); - if ( auto_load_next_post_params.alnp_remove_comments === 'yes' ) { + // It's up to you if you want to hide the comments. If the answer is yes then the comments will be gone. + if ( remove_comments === 'yes' ) { jQuery( comments_container ).remove(); // Remove Comments + if ( jQuery( comments_container ).length <= 0 ) { + console.log( 'Comments Removed' ); + } } - // Add divider + // Add a divider jQuery( content_container ).prepend( '
' ); - initialise_Scrollspy(); + // Initialise Scrollspy + initialise_scrollspy(); + + // Initialise History + initialise_history(); +}); // END document() - initialise_History(); -}); +function initialise_scrollspy() { + scrollspy(); +} // END initialise_scrollspy() -function initialise_Scrollspy() { - // Spy on post-divider - changes the URL in browser location, loads new post - jQuery('.post-divider').on('scrollSpy:exit', changeURL ); +function initialise_history() { + history(); +} // END initialise_history() + +function scrollspy() { + // Spy on post-divider - changes the URL in browser location, loads new post + jQuery('.post-divider').on('scrollSpy:exit', changeURL ); jQuery('.post-divider').on('scrollSpy:enter', changeURL ); jQuery('.post-divider').scrollSpy(); -} +} // END scrollspy() -function initialise_History() { +function history(){ // Bind to StateChange Event History.Adapter.bind(window,'statechange',function(){ // Note: We are using statechange instead of popstate var State = History.getState(); // Note: We are using History.getState() instead of event.state @@ -43,7 +57,7 @@ function initialise_History() { window.location.reload(State.url); } }); -} +} // END history() function changeURL() { var el = jQuery(this); @@ -52,34 +66,81 @@ function changeURL() { var offset = el.offset(); var scrollTop = jQuery(document).scrollTop(); - // If exiting or entering from top, change URL - if ( ( offset.top - scrollTop ) < 150 && curr_url != this_url) { + // If exiting or entering from top, change URL + if ( ( offset.top - scrollTop ) < 150 && curr_url != this_url ) { curr_url = this_url; History.pushState(null, null, this_url); window.document.title = this_title; - if( auto_load_next_post_params.alnp_google_analytics == 'yes' ) { - console.log( 'Google Analytics Tracked' ); + if ( track_pageviews == 'yes' ) { + console.log( 'Google Analytics Tracking Enabled' ); update_google_analytics(); - } + } // END if track_pageviews } auto_load_next_post(); -} -function updategoogle_analytics() { - if( typeof ga === 'undefined' ) { +} // END changeURL() + +/** + * This function tracks the page views using Google Analytics. + * + * It will first detect if Google Analytics is installed before + * attempting to send a pageview. + * + * The tracker detects both classic and universal tracking methods. + * + * Also supports Google Analytics by Yoast should it be used. + */ +function update_google_analytics() { + if ( typeof pageTracker === "undefined" || typeof _gaq === 'undefined' || typeof ga === 'undefined' || typeof __gaTracker === 'undefined' ) { + console.error( 'Google Analytics is not installed!' ); return; } - ga('send', 'pageview', window.location.pathname); -} + var track_page_url = window.location.pathname; + console.log( 'Track: ' + track_page_url ); + + // This uses Asynchronous version of Google Analytics tracking method. + if ( typeof pageTracker !== "undefined" && pageTracker !== null ) { + console.log( 'Google Analytics is installed, but old.' ); + pageTracker._trackPageview( track_page_url ); + } + + // This uses Google's classic Google Analytics tracking method. + if ( typeof _gaq !== 'undefined' && _gaq !== null ) { + console.log( 'Google Analytics is installed. Yahoo!' ); + _gaq.push(['_trackPageview', track_page_url]); + } + + // This uses Google Analytics Universal Analytics tracking method. + if ( typeof ga !== 'undefined' && _ga !== null ) { + console.log( 'Google Analytics Universal Analytics is installed. Yahoo!' ); + ga('send', 'pageview', track_page_url); + } + + // This uses Yoast's method of tracking Google Analytics. + if ( typeof __gaTracker !== 'undefined' && __gaTracker !== null ) { + console.log( 'Google Analytics by Yoast is installed. Awesome!' ); + __gaTracker('send', 'pageview', track_page_url); + } +} // END update_google_analytics() +/** + * This is the main function. + */ function auto_load_next_post() { // Grab the url for the next post var post_url = jQuery('a[rel="prev"]').attr('href'); - console.log( 'Next Post URL: ' + post_url ); + // For some browsers, `post_url` is undefined; for others, + // `post_url` is false. So we check for both possibilites. + if ( typeof post_url !== typeof undefined && post_url !== false ) { + console.log( 'Post URL was defined. All is good.' ); + console.log( 'Next Post URL: ' + post_url ); + } else { + console.error( 'Post URL was not defined. Oh dear!' ); + } if ( !post_url ) return; @@ -89,7 +150,7 @@ function auto_load_next_post() { } else { var partial_endpoint = 'partial/'; - if( post_url.charAt(post_url.length - 1) != '/') + if ( post_url.charAt(post_url.length - 1) != '/' ) partial_endpoint = '/' + partial_endpoint; np_url = post_url + partial_endpoint; @@ -97,10 +158,12 @@ function auto_load_next_post() { // Remove the post navigation HTML once the next post has loaded. jQuery( nav_container ).remove(); - console.log( 'Post Navigation Removed!' ); + if ( jQuery( nav_container ).length <= 0 ) { + console.log( 'Post Navigation Removed!' ); + } - jQuery.get( np_url , function( data ) { - var post = jQuery("
" + data + "
"); + jQuery.get( np_url , function( data ) { + var post = jQuery( "
" + data + "
" ); data = post.html(); // Return the HTML data of the next post that was loaded. @@ -115,7 +178,7 @@ function auto_load_next_post() { jQuery( 'hr[data-url="' + post_url + '"]').attr( 'data-title' , post_title.text() ).css( 'display', 'inline-block' ); // need to set up ScrollSpy on new content - initialise_Scrollspy(); + scrollspy(); }); -} \ No newline at end of file +} // END auto_load_next_post() diff --git a/assets/js/frontend/auto-load-next-post.min.js b/assets/js/frontend/auto-load-next-post.min.js index 743c6e4..88a36d9 100644 --- a/assets/js/frontend/auto-load-next-post.min.js +++ b/assets/js/frontend/auto-load-next-post.min.js @@ -1 +1 @@ -function initialise_Scrollspy(){jQuery(".post-divider").on("scrollSpy:exit",changeURL),jQuery(".post-divider").on("scrollSpy:enter",changeURL),jQuery(".post-divider").scrollSpy()}function initialise_History(){History.Adapter.bind(window,"statechange",function(){var a=History.getState();a.url!=curr_url&&window.location.reload(a.url)})}function changeURL(){var a=jQuery(this),b=a.attr("data-url"),c=a.attr("data-title"),d=a.offset(),e=jQuery(document).scrollTop();d.top-e<150&&curr_url!=b&&(curr_url=b,History.pushState(null,null,b),window.document.title=c,"yes"==auto_load_next_post_params.alnp_google_analytics&&(console.log("Google Analytics Tracked"),update_google_analytics())),auto_load_next_post()}function updategoogle_analytics(){"undefined"!==typeof ga&&ga("send","pageview",window.location.pathname)}function auto_load_next_post(){var a=jQuery('a[rel="prev"]').attr("href");if(console.log("Next Post URL: "+a),a){if(a.indexOf("?p=")>-1)np_url=a+"&partial=1";else{var b="partial/";"/"!=a.charAt(a.length-1)&&(b="/"+b),np_url=a+b}jQuery(nav_container).remove(),console.log("Post Navigation Removed!"),jQuery.get(np_url,function(b){var c=jQuery("
"+b+"
");b=c.html();var d=jQuery('
'+b),e=d.find(post_title_selector);console.log("Post Title: "+e.text()),jQuery(content_container).append(d),jQuery('hr[data-url="'+a+'"]').attr("data-title",e.text()).css("display","inline-block"),initialise_Scrollspy()})}}var content_container=auto_load_next_post_params.alnp_content_container,nav_container=auto_load_next_post_params.alnp_navigation_container,comments_container=auto_load_next_post_params.alnp_comments_container,post_title_selector=auto_load_next_post_params.alnp_title_selector,curr_url=window.location.href;jQuery.noConflict(),jQuery(document).ready(function(){window.location.href.indexOf("#comments")>-1||(console.log("Remove Comments: "+auto_load_next_post_params.alnp_remove_comments),"yes"===auto_load_next_post_params.alnp_remove_comments&&jQuery(comments_container).remove(),jQuery(content_container).prepend('
'),initialise_Scrollspy(),initialise_History())}); \ No newline at end of file +function initialise_scrollspy(){scrollspy()}function initialise_history(){history()}function scrollspy(){jQuery(".post-divider").on("scrollSpy:exit",changeURL),jQuery(".post-divider").on("scrollSpy:enter",changeURL),jQuery(".post-divider").scrollSpy()}function history(){History.Adapter.bind(window,"statechange",function(){var a=History.getState();a.url!=curr_url&&window.location.reload(a.url)})}function changeURL(){var a=jQuery(this),b=a.attr("data-url"),c=a.attr("data-title"),d=a.offset(),e=jQuery(document).scrollTop();d.top-e<150&&curr_url!=b&&(curr_url=b,History.pushState(null,null,b),window.document.title=c,"yes"==track_pageviews&&(console.log("Google Analytics Tracking Enabled"),update_google_analytics())),auto_load_next_post()}function update_google_analytics(){if("undefined"===typeof pageTracker||"undefined"===typeof _gaq||"undefined"===typeof ga||"undefined"===typeof __gaTracker)return void console.error("Google Analytics is not installed!");var a=window.location.pathname;console.log("Track: "+a),"undefined"!==typeof pageTracker&&null!==pageTracker&&(console.log("Google Analytics is installed, but old."),pageTracker._trackPageview(a)),"undefined"!==typeof _gaq&&null!==_gaq&&(console.log("Google Analytics is installed. Yahoo!"),_gaq.push(["_trackPageview",a])),"undefined"!==typeof ga&&null!==_ga&&(console.log("Google Analytics Universal Analytics is installed. Yahoo!"),ga("send","pageview",a)),"undefined"!==typeof __gaTracker&&null!==__gaTracker&&(console.log("Google Analytics by Yoast is installed. Awesome!"),__gaTracker("send","pageview",a))}function auto_load_next_post(){var a=jQuery('a[rel="prev"]').attr("href");if("undefined"!==typeof a&&a!==!1?(console.log("Post URL was defined. All is good."),console.log("Next Post URL: "+a)):console.error("Post URL was not defined. Oh dear!"),a){if(a.indexOf("?p=")>-1)np_url=a+"&partial=1";else{var b="partial/";"/"!=a.charAt(a.length-1)&&(b="/"+b),np_url=a+b}jQuery(nav_container).remove(),jQuery(nav_container).length<=0&&console.log("Post Navigation Removed!"),jQuery.get(np_url,function(b){var c=jQuery("
"+b+"
");b=c.html();var d=jQuery('
'+b),e=d.find(post_title_selector);console.log("Post Title: "+e.text()),jQuery(content_container).append(d),jQuery('hr[data-url="'+a+'"]').attr("data-title",e.text()).css("display","inline-block"),scrollspy()})}}var content_container=auto_load_next_post_params.alnp_content_container,post_title_selector=auto_load_next_post_params.alnp_title_selector,nav_container=auto_load_next_post_params.alnp_navigation_container,comments_container=auto_load_next_post_params.alnp_comments_container,remove_comments=auto_load_next_post_params.alnp_remove_comments,track_pageviews=auto_load_next_post_params.alnp_google_analytics,curr_url=window.location.href;jQuery.noConflict(),jQuery(document).ready(function(){window.location.href.indexOf("#comments")>-1||("yes"===remove_comments&&(jQuery(comments_container).remove(),jQuery(comments_container).length<=0&&console.log("Comments Removed")),jQuery(content_container).prepend('
'),initialise_scrollspy(),initialise_history())}); diff --git a/assets/js/chosen/chosen.jquery.js b/assets/js/libs/chosen/chosen.jquery.js similarity index 100% rename from assets/js/chosen/chosen.jquery.js rename to assets/js/libs/chosen/chosen.jquery.js diff --git a/assets/js/chosen/chosen.jquery.min.js b/assets/js/libs/chosen/chosen.jquery.min.js similarity index 100% rename from assets/js/chosen/chosen.jquery.min.js rename to assets/js/libs/chosen/chosen.jquery.min.js diff --git a/assets/js/jquery-tiptip/jquery.tipTip.js b/assets/js/libs/jquery-tiptip/jquery.tipTip.js similarity index 100% rename from assets/js/jquery-tiptip/jquery.tipTip.js rename to assets/js/libs/jquery-tiptip/jquery.tipTip.js diff --git a/assets/js/jquery-tiptip/jquery.tipTip.min.js b/assets/js/libs/jquery-tiptip/jquery.tipTip.min.js similarity index 100% rename from assets/js/jquery-tiptip/jquery.tipTip.min.js rename to assets/js/libs/jquery-tiptip/jquery.tipTip.min.js diff --git a/assets/js/frontend/jquery.history.js b/assets/js/libs/jquery.history.js similarity index 100% rename from assets/js/frontend/jquery.history.js rename to assets/js/libs/jquery.history.js diff --git a/assets/js/frontend/scrollspy.js b/assets/js/libs/scrollspy.js similarity index 100% rename from assets/js/frontend/scrollspy.js rename to assets/js/libs/scrollspy.js diff --git a/assets/js/frontend/scrollspy.min.js b/assets/js/libs/scrollspy.min.js similarity index 100% rename from assets/js/frontend/scrollspy.min.js rename to assets/js/libs/scrollspy.min.js diff --git a/auto-load-next-post.php b/auto-load-next-post.php index cdd3773..9fc9ed4 100644 --- a/auto-load-next-post.php +++ b/auto-load-next-post.php @@ -1,9 +1,9 @@ setup_constants(); + self::$_instance->load_plugin_textdomain(); + self::$_instance->includes(); } return self::$_instance; } // END instance() @@ -203,7 +81,7 @@ public static function instance() { */ public function __clone() { // Cloning instances of the class is forbidden - _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'auto-load-next-post' ), $this->version ); + _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'auto-load-next-post' ), AUTO_LOAD_NEXT_POST_VERSION ); } // END __clone() /** @@ -215,7 +93,7 @@ public function __clone() { */ public function __wakeup() { // Unserializing instances of the class is forbidden - _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'auto-load-next-post' ), $this->version ); + _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'auto-load-next-post' ), AUTO_LOAD_NEXT_POST_VERSION ); } // END __wakeup() /** @@ -223,7 +101,6 @@ public function __wakeup() { * * @since 1.0.0 * @access public - * @return void */ public function __construct() { // Auto-load classes on demand @@ -232,70 +109,11 @@ public function __construct() { spl_autoload_register( array( $this, 'autoload' ) ); - // Define constants - $this->define_constants(); - - // Check plugin requirements - $this->check_requirements(); - - // Include required files - $this->includes(); - // Hooks - add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'action_links' ) ); - add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 2 ); - add_action( 'init', array( $this, 'init_auto_load_next_post' ), 0 ); - add_action( 'wp_enqueue_scripts', array( $this, 'front_scripts_and_styles' ) ); - - // Loaded action - do_action( 'auto_load_next_post_loaded' ); + add_action( 'init', array( $this, 'init_auto_load_next_post' ), 0 ); + add_action( 'wp_enqueue_scripts', array( $this, 'front_scripts_and_styles' ) ); } // END __construct() - /** - * Plugin action links. - * - * @since 1.0.0 - * @access public - * @param mixed $links - * @return void - */ - public function action_links( $links ) { - if( current_user_can( $this->manage_plugin ) ) { - $plugin_links = array( - '' . __( 'Settings', 'auto-load-next-post' ) . '', - '' . __( 'Support', 'auto-load-next-post' ) . '' - ); - - return array_merge( $plugin_links, $links ); - } - return $links; - } // END action_links() - - /** - * Plugin row meta links - * - * @filter auto_load_next_post_about_text_link - * @filter auto_load_next_post_documentation_url - * @since 1.0.0 - * @access public - * @param array $input already defined meta links - * @param string $file plugin file path and name being processed - * @return array $input - */ - public function plugin_row_meta( $input, $file ) { - if ( plugin_basename( __FILE__ ) !== $file ) { - return $input; - } - - $links = array( - '' . __( 'Documentation', 'auto-load-next-post' ) . '', - ); - - $input = array_merge( $input, $links ); - - return $input; - } // END plugin_row_meta() - /** * Auto-load Auto Load Next Post classes on demand to reduce memory consumption. * @@ -306,80 +124,54 @@ public function plugin_row_meta( $input, $file ) { */ public function autoload( $class ) { $path = null; - $file = strtolower( 'class-' . str_replace( '_', '-', $class ) ) . '.php'; + $file = strtolower( 'class-'.str_replace( '_', '-', $class ) ).'.php'; if ( strpos( $class, 'auto_load_next_post_admin' ) === 0 ) { - $path = $this->plugin_path() . '/includes/admin/'; + $path = AUTO_LOAD_NEXT_POST_FILE_PATH.'/includes/admin/'; + } else if ( strpos( $class, 'auto_load_next_post_' ) === 0 ) { + $path = AUTO_LOAD_NEXT_POST_FILE_PATH.'/includes/'; } - if ( $path && is_readable( $path . $file ) ) { - include_once( $path . $file ); - return; - } - - // Fallback - if ( strpos( $class, 'auto_load_next_post_' ) === 0 ) { - $path = $this->plugin_path() . '/includes/'; - } - - if ( $path && is_readable( $path . $file ) ) { - include_once( $path . $file ); - return; + if ( $path !== null && is_readable( $path.$file ) ) { + include_once( $path.$file ); + return true; } } // END autoload() /** - * Define Constants + * Setup Constants * - * @since 1.0.0 + * @since 1.4.3 * @access private */ - private function define_constants() { - if ( ! defined( 'AUTO_LOAD_NEXT_POST' ) ) define( 'AUTO_LOAD_NEXT_POST', $this->name ); - if ( ! defined( 'AUTO_LOAD_NEXT_POST_FILE' ) ) define( 'AUTO_LOAD_NEXT_POST_FILE', __FILE__ ); - if ( ! defined( 'AUTO_LOAD_NEXT_POST_VERSION' ) ) define( 'AUTO_LOAD_NEXT_POST_VERSION', $this->version ); - if ( ! defined( 'AUTO_LOAD_NEXT_POST_WP_VERSION_REQUIRE' ) ) define( 'AUTO_LOAD_NEXT_POST_WP_VERSION_REQUIRE', $this->wp_version_min ); - if ( ! defined( 'AUTO_LOAD_NEXT_POST_SCREEN_ID' ) ) define( 'AUTO_LOAD_NEXT_POST_SCREEN_ID', 'auto-load-next-post-settings' ); - if ( ! defined( 'AUTO_LOAD_NEXT_POST_SLUG' ) ) define( 'AUTO_LOAD_NEXT_POST_SLUG', $this->plugin_slug ); - if ( ! defined( 'AUTO_LOAD_NEXT_POST_TEXT_DOMAIN' ) ) define( 'AUTO_LOAD_NEXT_POST_TEXT_DOMAIN', $this->text_domain ); - if ( ! defined( 'AUTO_LOAD_NEXT_POST_DEFAULT_SETTINGS_TAB' ) ) define( 'AUTO_LOAD_NEXT_POST_DEFAULT_SETTINGS_TAB', 'general'); - if ( ! defined( 'AUTO_LOAD_NEXT_POST_GITHUB_REPO_URI' ) ) define( 'AUTO_LOAD_NEXT_POST_GITHUB_REPO_URI', $this->github_repo_url ); + private function setup_constants() { + $this->define( 'AUTO_LOAD_NEXT_POST_VERSION', '1.4.3' ); + $this->define( 'AUTO_LOAD_NEXT_POST_FILE', __FILE__ ); + $this->define( 'AUTO_LOAD_NEXT_POST_SLUG', 'auto-load-next-post' ); - $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; - if ( ! defined( 'AUTO_LOAD_NEXT_POST_SCRIPT_MODE' ) ) define( 'AUTO_LOAD_NEXT_POST_SCRIPT_MODE', $suffix ); + $this->define( 'AUTO_LOAD_NEXT_POST_URL_PATH', untrailingslashit( plugins_url( '/', __FILE__ ) ) ); + $this->define( 'AUTO_LOAD_NEXT_POST_FILE_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) ); + $this->define( 'AUTO_LOAD_NEXT_POST_TEMPLATE_PATH', 'auto-load-next-post/' ); - } // END define_constants() + $this->define( 'AUTO_LOAD_NEXT_POST_WP_VERSION_REQUIRE', '4.0' ); + + $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; + $this->define( 'AUTO_LOAD_NEXT_POST_SCRIPT_MODE', $suffix ); + } // END setup_constants() /** - * Checks that the WordPress setup meets the plugin requirements. + * Define constant if not already set. * - * @since 1.0.0 + * @param string $name + * @param string|bool $value * @access private - * @global string $wp_version - * @return bool + * @since 1.4.3 */ - private function check_requirements() { - global $wp_version; - - if ( ! version_compare( $wp_version, AUTO_LOAD_NEXT_POST_WP_VERSION_REQUIRE, '>=' ) ) { - add_action( 'admin_notices', array( $this, 'display_req_notice' ) ); - return false; + private function define( $name, $value ) { + if ( ! defined( $name ) ) { + define( $name, $value ); } - - return true; - } // END check_requirements() - - /** - * Display the requirement notice. - * - * @since 1.0.0 - * @access static - */ - static function display_req_notice() { - echo '

'; - echo sprintf( __('Sorry, %s requires WordPress ' . AUTO_LOAD_NEXT_POST_WP_VERSION_REQUIRE . ' or higher. Please upgrade your WordPress setup', 'auto-load-next-post'), AUTO_LOAD_NEXT_POST ); - echo '

'; - } // END display_req_notice() + } /** * Include required core files used in admin and on the frontend. @@ -392,37 +184,21 @@ public function includes() { include_once( 'includes/auto-load-next-post-core-functions.php' ); // Contains core functions for the front/back end. if ( is_admin() ) { - $this->admin_includes(); + include_once( 'includes/admin/class-auto-load-next-post-admin.php' ); // Admin section } } // END includes() - /** - * Include required admin files. - * - * @since 1.0.0 - * @access public - * @return void - */ - public function admin_includes() { - include_once( 'includes/admin/class-auto-load-next-post-install.php' ); // Install plugin - include_once( 'includes/admin/class-auto-load-next-post-admin.php' ); // Admin section - } // END admin_includes() - /** * Runs when the plugin is initialized. * * @since 1.0.0 * @access public - * @filter auto_load_next_post_force_ssl_filter */ public function init_auto_load_next_post() { add_rewrite_endpoint( 'partial', EP_PERMALINK ); // Refresh permalinks flush_rewrite_rules(); - - // Set up localisation - $this->load_plugin_textdomain(); } // END init_auto_load_next_post() /** @@ -439,94 +215,59 @@ public function init_auto_load_next_post() { */ public function load_plugin_textdomain() { // Set filter for plugin's languages directory - $lang_dir = dirname( plugin_basename( AUTO_LOAD_NEXT_POST_FILE ) ) . '/languages/'; + $lang_dir = dirname( plugin_basename( AUTO_LOAD_NEXT_POST_FILE ) ).'/languages/'; $lang_dir = apply_filters( 'auto_load_next_post_languages_directory', $lang_dir ); // Traditional WordPress plugin locale filter - $locale = apply_filters( 'plugin_locale', get_locale(), $this->text_domain ); - $mofile = sprintf( '%1$s-%2$s.mo', $this->text_domain, $locale ); + $locale = apply_filters( 'plugin_locale', get_locale(), 'auto-load-next-post' ); + $mofile = sprintf( '%1$s-%2$s.mo', 'auto-load-next-post', $locale ); // Setup paths to current locale file - $mofile_local = $lang_dir . $mofile; - $mofile_global = WP_LANG_DIR . '/' . $this->text_domain . '/' . $mofile; + $mofile_local = $lang_dir.$mofile; + $mofile_global = WP_LANG_DIR.'/auto-load-next-post/'.$mofile; if ( file_exists( $mofile_global ) ) { // Look in global /wp-content/languages/auto-load-next-post/ folder - load_textdomain( $this->text_domain, $mofile_global ); + load_textdomain( 'auto-load-next-post', $mofile_global ); } else if ( file_exists( $mofile_local ) ) { // Look in local /wp-content/plugins/auto-load-next-post/languages/ folder - load_textdomain( $this->text_domain, $mofile_local ); + load_textdomain( 'auto-load-next-post', $mofile_local ); } else { // Load the default language files - load_plugin_textdomain( $this->text_domain, false, $lang_dir ); + load_plugin_textdomain( 'auto-load-next-post', false, $lang_dir ); } } // END load_plugin_textdomain() /** Helper functions ******************************************************/ - /** - * Get the plugin url. - * - * @since 1.0.0 - * @access public - * @return string - */ - public function plugin_url() { - return untrailingslashit( plugins_url( '/', __FILE__ ) ); - } // END plugin_url() - - /** - * Get the plugin path. - * - * @since 1.0.0 - * @access public - * @return string - */ - public function plugin_path() { - return untrailingslashit( plugin_dir_path( __FILE__ ) ); - } // END plugin_path() - - /** - * Get the plugin template path. - * - * @since 1.3.2 - * @access public - * @return string - */ - public function template_path() { - return 'auto-load-next-post/'; - } // END template_path() - /** * Registers and enqueues stylesheets and javascripts * for the front of the site. * * @since 1.3.2 * @access public - * @filter auto_load_next_post_params */ public function front_scripts_and_styles() { /** * Load Javascript if found as a singluar post either, * single or page and is one of the selected post types. */ - if ( is_singular() && in_array( get_post_type(), get_option( 'auto_load_next_post_get_post_types' ) ) ) { - $this->load_file( $this->plugin_slug . '-scrollspy', '/assets/js/frontend/scrollspy' . AUTO_LOAD_NEXT_POST_SCRIPT_MODE . '.js', true, array('jquery'), $this->version ); - $this->load_file( $this->plugin_slug . '-history', '/assets/js/frontend/jquery.history.js', true, array('jquery'), $this->version ); - $this->load_file( $this->plugin_slug . '-script', '/assets/js/frontend/auto-load-next-post' . AUTO_LOAD_NEXT_POST_SCRIPT_MODE . '.js', true, array( $this->plugin_slug . '-scrollspy' ), $this->version ); + if ( supports_alnp() && is_singular() && in_array( get_post_type(), get_option( 'auto_load_next_post_get_post_types' ) ) ) { + $this->load_file( 'auto-load-next-post-scrollspy', '/assets/js/libs/scrollspy'.AUTO_LOAD_NEXT_POST_SCRIPT_MODE.'.js', true, array('jquery'), AUTO_LOAD_NEXT_POST_VERSION ); + $this->load_file( 'auto-load-next-post-history', '/assets/js/libs/jquery.history.js', true, array('jquery'), AUTO_LOAD_NEXT_POST_VERSION ); + $this->load_file( 'auto-load-next-post-script', '/assets/js/frontend/auto-load-next-post'.AUTO_LOAD_NEXT_POST_SCRIPT_MODE.'.js', true, array( 'auto-load-next-post-scrollspy' ), AUTO_LOAD_NEXT_POST_VERSION ); // Variables for JS scripts - wp_localize_script( $this->plugin_slug . '-script', 'auto_load_next_post_params', apply_filters( 'auto_load_next_post_params', array( - 'alnp_content_container' => get_option( 'auto_load_next_post_content_container' ), - 'alnp_post_id_selector' => get_option( 'auto_load_next_post_id_selector' ), - 'alnp_title_selector' => get_option( 'auto_load_next_post_title_selector' ), - 'alnp_navigation_container' => get_option( 'auto_load_next_post_navigation_container' ), - 'alnp_comments_container' => get_option( 'auto_load_next_post_comments_container' ), - 'alnp_remove_comments' => get_option( 'auto_load_next_post_remove_comments' ), - 'alnp_google_analytics' => get_option( 'auto_load_next_post_google_analytics' ), - ) ) ); + wp_localize_script( 'auto-load-next-post-script', 'auto_load_next_post_params', array( + 'alnp_content_container' => get_option( 'auto_load_next_post_content_container' ), + 'alnp_title_selector' => get_option( 'auto_load_next_post_title_selector' ), + 'alnp_navigation_container' => get_option( 'auto_load_next_post_navigation_container' ), + 'alnp_comments_container' => get_option( 'auto_load_next_post_comments_container' ), + 'alnp_remove_comments' => get_option( 'auto_load_next_post_remove_comments' ), + 'alnp_google_analytics' => get_option( 'auto_load_next_post_google_analytics' ), + ) ); } // END if is_singular() && get_post_type() } // END register_scripts_and_styles() @@ -534,7 +275,7 @@ public function front_scripts_and_styles() { * Helper function for registering and enqueueing scripts and styles. * * @since 1.0.0 - * @access public + * @access public static * @param string $name The ID to register with WordPress. * @param string $file_path The path to the actual file. * @param bool $is_script Optional, argument for if the incoming file_path is a JavaScript source file. @@ -542,13 +283,12 @@ public function front_scripts_and_styles() { * @param string $version Optional, can match the version of the plugin or version of the source file. * @global string $wp_version */ - public function load_file( $name, $file_path, $is_script = false, $support = array(), $version = '' ) { + public static function load_file( $name, $file_path, $is_script = false, $support = array(), $version = '' ) { global $wp_version; - $url = $this->plugin_url() . $file_path; - $file = $this->plugin_path() . $file_path; + $url = AUTO_LOAD_NEXT_POST_URL_PATH.$file_path; // URL to the file. - if ( file_exists( $file ) ) { + if ( file_exists( AUTO_LOAD_NEXT_POST_FILE_PATH.$file_path ) ) { if ( $is_script ) { wp_register_script( $name, $url, $support, $version ); wp_enqueue_script( $name ); @@ -563,17 +303,7 @@ public function load_file( $name, $file_path, $is_script = false, $support = arr } // END Auto_Load_Next_Post() -} // END class_exists('Auto_Load_Next_Post') - -/** - * Returns the instance of Auto_Load_Next_Post to prevent the need to use globals. - * - * @since 1.0.0 - * @return Auto Load Next Post - */ -function Auto_Load_Next_Post() { - return Auto_Load_Next_Post::instance(); -} +} // END class exists 'Auto_Load_Next_Post' -// Run Plugin -Auto_Load_Next_Post(); +// Run the Plugin +return Auto_Load_Next_Post::instance(); diff --git a/includes/admin/auto-load-next-post-admin-functions.php b/includes/admin/auto-load-next-post-admin-functions.php deleted file mode 100644 index 95a9997..0000000 --- a/includes/admin/auto-load-next-post-admin-functions.php +++ /dev/null @@ -1,27 +0,0 @@ -does_it_meet_required_php_version( PHP_VERSION ) ) { + add_action( 'plugins_loaded', array( $this, 'run_activation' ) ); + } else { + // If the required PHP version is not avaialble then deactivate the plugin. + deactivate_plugins( plugin_basename( AUTO_LOAD_NEXT_POST_FILE ) ); + return false; + } // END if/else + } // END __construct() + + /** + * Now we are ready so let's install the plugin. + * + * @access public + * @since 1.0.0 + */ + public function run_activation(){ + include_once( 'class-auto-load-next-post-install.php' ); + $install_plugin = new Auto_Load_Next_Post_Install; + $install_plugin->install(); + } + + } // END if class. + +} // END if class exists. + +return new Auto_Load_Next_Post_Activation(); diff --git a/includes/admin/class-auto-load-next-post-admin-help.php b/includes/admin/class-auto-load-next-post-admin-help.php index dcae8a3..d91f778 100644 --- a/includes/admin/class-auto-load-next-post-admin-help.php +++ b/includes/admin/class-auto-load-next-post-admin-help.php @@ -25,7 +25,6 @@ class Auto_Load_Next_Post_Admin_Help { * * @since 1.0.0 * @access public - * @return void */ public function __construct() { add_action( 'current_screen', array( $this, 'add_help_tabs' ), 50 ); @@ -40,38 +39,30 @@ public function __construct() { public function add_help_tabs() { $screen = get_current_screen(); - if ( ! in_array( $screen->id, auto_load_next_post_get_screen_ids() ) ) + if ( $screen->id != 'settings_page_auto-load-next-post-settings' ) return; $screen->add_help_tab( array( 'id' => 'auto_load_next_post_docs_tab', - 'title' => __( 'Documentation', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), + 'title' => __( 'Documentation', 'auto-load-next-post' ), 'content' => - '

' . sprintf( __( 'Thank you for using %s :) Should you need help using or extending %s please read the documentation.', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), Auto_Load_Next_Post()->name, Auto_Load_Next_Post()->name ) . '

' . - '

' . sprintf( __( '%s Documentation', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), Auto_Load_Next_Post()->name ) . '

' - ) ); - - $screen->add_help_tab( array( - 'id' => 'auto_load_next_post_support_tab', - 'title' => __( 'Support', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), - 'content' => - '

' . sprintf( __( 'After reading the documentation, for further assistance you can use the community forum.', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), Auto_Load_Next_Post()->doc_url, Auto_Load_Next_Post()->wp_plugin_support_url ) . '

' . - '

' . __( 'Community Support', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ) . '

' + '

'.sprintf( __( 'Thank you for using %1$s :) Should you need help using %1$s please read the documentation.', 'auto-load-next-post' ), 'Auto Load Next Post' ).'

' . + '

'.sprintf( __( '%s Documentation', 'auto-load-next-post' ), 'Auto Load Next Post' ).'

' ) ); $screen->add_help_tab( array( 'id' => 'auto_load_next_post_bugs_tab', - 'title' => __( 'Found a bug?', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), + 'title' => __( 'Found a bug?', 'auto-load-next-post' ), 'content' => - '

' . sprintf( __( 'If you find a bug within %s you can create a ticket via Github issues. Ensure you read the contribution guide prior to submitting your report. Be as descriptive as possible. Thank you.', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), Auto_Load_Next_Post()->name, AUTO_LOAD_NEXT_POST_GITHUB_REPO_URI . 'issues?state=open', AUTO_LOAD_NEXT_POST_GITHUB_REPO_URI . 'blob/master/CONTRIBUTING.md' ) . '

' . - '

' . __( 'Report a bug', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ) . '

' + '

'.sprintf( __( 'If you find a bug within %s you can create a ticket via Github issues. Ensure you read the contribution guide prior to submitting your report. Be as descriptive as possible. Thank you.', 'auto-load-next-post' ), 'Auto Load Next Post', 'https://github.com/seb86/Auto-Load-Next-Post/issues?state=open', 'https://github.com/seb86/Auto-Load-Next-Post/blob/master/CONTRIBUTING.md' ).'

' . + '

'.__( 'Report a bug', 'auto-load-next-post' ).'

' ) ); $screen->set_help_sidebar( - '

' . __( 'For more information:', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ) . '

' . - '

' . sprintf( __( 'About %s', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), Auto_Load_Next_Post()->name ) . '

' . - '

' . __( 'Project on WordPress.org', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ) . '

' . - '

' . __( 'Project on Github', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ) . '

' + '

'.__( 'For more information:', 'auto-load-next-post' ).'

' . + '

'.sprintf( __( 'About %s', 'auto-load-next-post' ), 'Auto Load Next Post' ).'

' . + '

'.__( 'Project on WordPress.org', 'auto-load-next-post' ).'

' . + '

'.__( 'Project on Github', 'auto-load-next-post' ).'

' ); } // END add_help_tabs() diff --git a/includes/admin/class-auto-load-next-post-admin-menus.php b/includes/admin/class-auto-load-next-post-admin-menus.php index 5dbae0f..38cb55a 100644 --- a/includes/admin/class-auto-load-next-post-admin-menus.php +++ b/includes/admin/class-auto-load-next-post-admin-menus.php @@ -25,7 +25,6 @@ class Auto_Load_Next_Post_Admin_Menus { * * @since 1.0.0 * @access public - * @return void */ public function __construct() { // Add admin menus @@ -42,11 +41,9 @@ public function __construct() { * @global $wp_version */ public function admin_menu() { - global $menu, $auto_load_next_post, $wp_version; + global $menu, $wp_version; - add_options_page( sprintf( __( '%s Settings', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), Auto_Load_Next_Post()->title_name ), 'Auto Load Next Post', Auto_Load_Next_Post()->manage_plugin, 'auto-load-next-post-settings', array( $this, 'settings_page' ) ); - - register_setting( 'auto_load_next_post_status_settings_fields', 'auto_load_next_post_status_options' ); + add_options_page( sprintf( __( '%s Settings', 'auto-load-next-post' ), 'Auto Load Next Post' ), 'Auto Load Next Post', 'manage_options', 'auto-load-next-post-settings', array( $this, 'settings_page' ) ); } // END admin_menu() /** @@ -56,6 +53,7 @@ public function admin_menu() { */ public function settings_page() { include_once( 'class-auto-load-next-post-admin-settings.php' ); + Auto_Load_Next_Post_Admin_Settings::output(); } diff --git a/includes/admin/class-auto-load-next-post-admin-notices.php b/includes/admin/class-auto-load-next-post-admin-notices.php index 0d36b89..73f56d9 100644 --- a/includes/admin/class-auto-load-next-post-admin-notices.php +++ b/includes/admin/class-auto-load-next-post-admin-notices.php @@ -25,14 +25,15 @@ class Auto_Load_Next_Post_Admin_Notices { * * @since 1.3.2 * @access public - * @return void */ public function __construct() { - add_action( 'admin_print_styles', array( $this, 'add_notices' ) ); + add_action( 'admin_init', array( $this, 'check_wp' ) ); + add_action( 'admin_init', array( $this, 'add_notices' ) ); } // END __construct() /** - * Add admin notices and styles when needed. + * Checks if the theme supports the plugin. + * If not, then a notice is displayed explaining what to do next. * * @since 1.3.2 * @access public @@ -40,7 +41,7 @@ public function __construct() { public function add_notices() { $template = get_option( 'template' ); - if ( ! current_theme_supports( 'auto-load-next-post' ) ) { + if ( ! supports_alnp() ) { if ( ! empty( $_GET['hide_auto_load_next_post_theme_support_check'] ) ) { update_option( 'auto_load_next_post_theme_support_check', $template ); @@ -48,7 +49,6 @@ public function add_notices() { } if ( get_option( 'auto_load_next_post_theme_support_check' ) !== $template ) { - wp_enqueue_style( 'auto-load-next-post-activation', Auto_Load_Next_Post()->plugin_url() . '/assets/css/admin/activation.css' ); add_action( 'admin_notices', array( $this, 'theme_check_notice' ) ); } @@ -56,7 +56,36 @@ public function add_notices() { } // END add_notices() /** - * Show the Theme Check notice. + * Checks that the WordPress version meets the plugin requirement. + * + * @since 1.0.0 + * @access prublic + * @global string $wp_version + * @return bool + */ + public function check_wp() { + global $wp_version; + + if ( ! version_compare( $wp_version, AUTO_LOAD_NEXT_POST_WP_VERSION_REQUIRE, '>=' ) ) { + add_action( 'admin_notices', array( $this, 'requirement_wp_notice' ) ); + return false; + } + + return true; + } // END check_requirements() + + /** + * Show the WordPress requirement notice. + * + * @since 1.4.3 + * @access public + */ + public function requirement_wp_notice() { + include( 'views/html-notice-requirement-wp.php' ); + } // END display_req_notice() + + /** + * Show the theme check notice. * * @since 1.3.2 * @access public diff --git a/includes/admin/class-auto-load-next-post-admin-settings.php b/includes/admin/class-auto-load-next-post-admin-settings.php index 01ee5d5..53c198f 100644 --- a/includes/admin/class-auto-load-next-post-admin-settings.php +++ b/includes/admin/class-auto-load-next-post-admin-settings.php @@ -29,7 +29,6 @@ class Auto_Load_Next_Post_Admin_Settings { * * @since 1.0.0 * @access public static - * @filter auto_load_next_post_get_settings_pages * @return $settings */ public static function get_settings_pages() { @@ -38,8 +37,7 @@ public static function get_settings_pages() { include_once( 'settings/class-auto-load-next-post-settings-page.php' ); $settings[] = include( 'settings/class-auto-load-next-post-settings-general.php' ); - - self::$settings = apply_filters( 'auto_load_next_post_get_settings_pages', $settings ); + $settings[] = include( 'settings/class-auto-load-next-post-settings-support.php' ); } return self::$settings; @@ -57,15 +55,15 @@ public static function save() { global $current_section, $current_tab; if ( empty( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'auto-load-next-post-settings' ) ) { - die( __( 'Action failed. Please refresh the page and retry.', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ) ); + wp_die( __( 'Action failed. Please refresh the page and retry.', 'auto-load-next-post' ) ); } // Trigger actions - do_action( 'auto_load_next_post_settings_save_' . $current_tab ); - do_action( 'auto_load_next_post_update_options_' . $current_tab ); + do_action( 'auto_load_next_post_settings_save_'.$current_tab ); + do_action( 'auto_load_next_post_update_options_'.$current_tab ); do_action( 'auto_load_next_post_update_options' ); - self::add_message( __( 'Your settings have been saved.', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ) ); + self::add_message( __( 'Your settings have been saved.', 'auto-load-next-post' ) ); do_action( 'auto_load_next_post_settings_saved' ); } // END save() @@ -102,12 +100,12 @@ public static function add_error( $text ) { public static function show_messages() { if ( sizeof( self::$errors ) > 0 ) { foreach ( self::$errors as $error ) { - echo '

' . esc_html( $error ) . '

'; + echo '

'.esc_html( $error ).'

'; } } elseif ( sizeof( self::$messages ) > 0 ) { foreach ( self::$messages as $message ) { - echo '

' . esc_html( $message ) . '

'; + echo '

'.esc_html( $message ).'

'; } } } // END show_messages() @@ -119,7 +117,6 @@ public static function show_messages() { * * @since 1.0.0 * @access public static - * @filter auto_load_next_post_settings_params * @filter auto_load_next_post_settings_tabs_array * @global $current_section * @global $current_tab @@ -129,14 +126,14 @@ public static function output() { global $current_section, $current_tab; // Get current tab or section - $current_tab = empty( $_GET['tab'] ) ? AUTO_LOAD_NEXT_POST_DEFAULT_SETTINGS_TAB : sanitize_text_field( urldecode( $_GET['tab'] ) ); - $current_section = empty( $_REQUEST['section'] ) ? '' : sanitize_text_field( urldecode( $_REQUEST['section'] ) ); + $current_tab = empty( $_GET['tab'] ) ? 'general' : sanitize_text_field( urldecode( $_GET['tab'] ) ); + $current_section = empty( $_REQUEST['section'] ) ? 'woocommerce' : sanitize_text_field( urldecode( $_REQUEST['section'] ) ); - wp_enqueue_script( 'auto_load_next_post_settings', Auto_Load_Next_Post()->plugin_url() . '/assets/js/admin/settings' . AUTO_LOAD_NEXT_POST_SCRIPT_MODE . '.js', array( 'jquery' ), Auto_Load_Next_Post()->version, true ); + wp_enqueue_script( 'auto_load_next_post_settings', AUTO_LOAD_NEXT_POST_URL_PATH.'/assets/js/admin/settings'.AUTO_LOAD_NEXT_POST_SCRIPT_MODE.'.js', array( 'jquery' ), AUTO_LOAD_NEXT_POST_VERSION, true ); - wp_localize_script( 'auto_load_next_post_settings', 'auto_load_next_post_settings_params', apply_filters( 'auto_load_next_post_settings_params', array( - 'i18n_nav_warning' => __( 'The changes you made will be lost if you navigate away from this page.', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), - ) ) ); + wp_localize_script( 'auto_load_next_post_settings', 'auto_load_next_post_settings_params', array( + 'i18n_nav_warning' => __( 'The changes you made will be lost if you navigate away from this page.', 'auto-load-next-post' ), + ) ); // Include settings pages self::get_settings_pages(); @@ -230,7 +227,7 @@ public static function output_fields( $options ) { if ( ! empty( $value['custom_attributes'] ) && is_array( $value['custom_attributes'] ) ) { foreach ( $value['custom_attributes'] as $attribute => $attribute_value ) { - $custom_attributes[] = esc_attr( $attribute ) . '="' . esc_attr( $attribute_value ) . '"'; + $custom_attributes[] = esc_attr( $attribute ).'="'.esc_attr( $attribute_value ).'"'; } } @@ -252,17 +249,17 @@ public static function output_fields( $options ) { } if ( $description && in_array( $value['type'], array( 'textarea', 'radio' ) ) ) { - $description = '

' . wp_kses_post( $description ) . '

'; + $description = '

'.wp_kses_post( $description ).'

'; } else if ( $description ) { - $description = '' . wp_kses_post( $description ) . ''; + $description = ''.wp_kses_post( $description ).''; } if ( $tip && in_array( $value['type'], array( 'checkbox' ) ) ) { - $tip = '

' . $tip . '

'; + $tip = '

'.$tip.'

'; } else if ( $tip ) { - $tip = ''; + $tip = ''; } // Switch based on type @@ -270,7 +267,7 @@ public static function output_fields( $options ) { // Section Titles case 'title': if ( ! empty( $value['title'] ) ) { - echo '

' . esc_html( $value['title'] ) . '

'; + echo '

'.esc_html( $value['title'] ).'

'; } if ( ! empty( $value['desc'] ) ) { @@ -280,7 +277,7 @@ public static function output_fields( $options ) { echo ''. "\n\n"; if ( ! empty( $value['id'] ) ) { - do_action( 'auto_load_next_post_settings_' . sanitize_title( $value['id'] ) ); + do_action( 'auto_load_next_post_settings_'.sanitize_title( $value['id'] ) ); } break; @@ -289,13 +286,13 @@ public static function output_fields( $options ) { case 'sectionend': if ( ! empty( $value['id'] ) ) { - do_action( 'auto_load_next_post_settings_' . sanitize_title( $value['id'] ) . '_end' ); + do_action( 'auto_load_next_post_settings_'.sanitize_title( $value['id'] ).'_end' ); } echo '
'; if ( ! empty( $value['id'] ) ) { - do_action( 'auto_load_next_post_settings_' . sanitize_title( $value['id'] ) . '_after' ); + do_action( 'auto_load_next_post_settings_'.sanitize_title( $value['id'] ).'_after' ); } break; @@ -313,7 +310,7 @@ public static function output_fields( $options ) { if ( $value['type'] == 'color' ) { $type = 'text'; $value['class'] .= 'colorpick'; - $description .= ''; + $description .= ''; } ?> @@ -486,7 +483,7 @@ class="" × px - + " ?> - + " // Default: run an action default: - do_action( 'auto_load_next_post_admin_field_' . $value['type'], $value ); + do_action( 'auto_load_next_post_admin_field_'.$value['type'], $value ); break; } // end switch @@ -626,7 +623,7 @@ public static function save_fields( $options, $current_tab, $current_section = ' // Custom handling default : - do_action( 'auto_load_next_post_update_option_' . $type, $value ); + do_action( 'auto_load_next_post_update_option_'.$type, $value ); break; @@ -673,10 +670,10 @@ public static function save_fields( $options, $current_tab, $current_section = ' // Save all options as an array. Ready for export. if ( empty( $current_section ) ) { - update_option( 'auto_load_next_post_options_' . $current_tab, $update_options ); + update_option( 'auto_load_next_post_options_'.$current_tab, $update_options ); } else { - update_option( 'auto_load_next_post_options_' . $current_tab . '_' . $current_section, $update_options ); + update_option( 'auto_load_next_post_options_'.$current_tab.'_'.$current_section, $update_options ); } return true; diff --git a/includes/admin/class-auto-load-next-post-admin.php b/includes/admin/class-auto-load-next-post-admin.php index 7a7087a..abaf1e3 100644 --- a/includes/admin/class-auto-load-next-post-admin.php +++ b/includes/admin/class-auto-load-next-post-admin.php @@ -28,35 +28,78 @@ class Auto_Load_Next_Post_Admin { */ public function __construct() { // Actions - add_action( 'init', array( $this, 'includes' ), 0 ); - add_action( 'admin_init', array( $this, 'register_scripts_and_styles' ), 10 ); + add_action( 'init', array( $this, 'includes' ), 10 ); + add_action( 'admin_init', array( $this, 'admin_scripts' ), 100 ); // Filters - add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ) ); - add_filter( 'update_footer', array( $this, 'update_footer' ), 15 ); + add_filter( 'plugin_action_links_'.plugin_basename( AUTO_LOAD_NEXT_POST_FILE ), array( $this, 'action_links' ) ); + add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 2 ); + add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ) ); + add_filter( 'update_footer', array( $this, 'update_footer' ), 15 ); } // END __construct() + /** + * Plugin action links. + * + * @since 1.0.0 + * @access public + * @param mixed $links + * @return void + */ + public function action_links( $links ) { + if ( current_user_can( 'manage_options' ) ) { + $plugin_links = array( + ''.__( 'Upgrade to Premium', 'auto-load-next-post' ).'', + ''.__( 'Settings', 'auto-load-next-post' ).'', + ''.__( 'Support', 'auto-load-next-post' ).'', + ); + + return array_merge( $plugin_links, $links ); + } + + return $links; + } // END action_links() + + /** + * Plugin row meta links + * + * @since 1.0.0 + * @access public + * @param array $input already defined meta links + * @param string $file plugin file path and name being processed + * @return array $input + */ + public function plugin_row_meta( $input, $file ) { + if ( plugin_basename( AUTO_LOAD_NEXT_POST_FILE ) !== $file ) { + return $input; + } + + $links = array( + ''.__( 'Documentation', 'auto-load-next-post' ).'', + ''.__( 'Community Support', 'auto-load-next-post' ).'' + ); + + $input = array_merge( $input, $links ); + + return $input; + } // END plugin_row_meta() + /** * Include any classes we need within admin. * * @since 1.0.0 * @access public - * @filter auto_load_next_post_enable_admin_help_tab */ public function includes() { - // Functions - include( 'auto-load-next-post-admin-functions.php' ); + // The plugin checks requirements on activation before it does other stuff. + include_once( 'class-auto-load-next-post-admin-activation.php' ); // Classes we only need if the ajax is not-ajax - if ( ! auto_load_next_post_is_ajax() ) { - // Main Plugin - include( 'class-auto-load-next-post-admin-menus.php' ); - include( 'class-auto-load-next-post-admin-notices.php' ); - - // Plugin Help - if ( apply_filters( 'auto_load_next_post_enable_admin_help_tab', true ) ) { - include( 'class-auto-load-next-post-admin-help.php' ); - } + if ( !auto_load_next_post_is_ajax() ) { + include( 'class-auto-load-next-post-install.php' ); // Install Plugin + include( 'class-auto-load-next-post-admin-menus.php' ); // Plugin Menu + include( 'class-auto-load-next-post-admin-notices.php' ); // Plugin Notices + include( 'class-auto-load-next-post-admin-help.php' ); // Plugin Help Tab } } // END includes() @@ -66,30 +109,25 @@ public function includes() { * * @since 1.0.0 * @access public - * @filter auto_load_next_post_admin_params */ - public function register_scripts_and_styles() { - Auto_Load_Next_Post()->load_file( Auto_Load_Next_Post()->plugin_slug . '_admin_script', '/assets/js/admin/auto-load-next-post' . AUTO_LOAD_NEXT_POST_SCRIPT_MODE . '.js', true, array('jquery'), Auto_Load_Next_Post()->version ); - + public function admin_scripts() { + // Auto Load Next Post Main Javascript + Auto_Load_Next_Post::load_file( AUTO_LOAD_NEXT_POST_SLUG.'_admin_script', '/assets/js/admin/auto-load-next-post'.AUTO_LOAD_NEXT_POST_SCRIPT_MODE.'.js', true, array('jquery'), AUTO_LOAD_NEXT_POST_VERSION ); // Chosen - Auto_Load_Next_Post()->load_file( 'chosen', '/assets/js/chosen/chosen.jquery' . AUTO_LOAD_NEXT_POST_SCRIPT_MODE . '.js', true, array('jquery'), Auto_Load_Next_Post()->version ); - + Auto_Load_Next_Post::load_file( 'chosen', '/assets/js/libs/chosen/chosen.jquery'.AUTO_LOAD_NEXT_POST_SCRIPT_MODE.'.js', true, array('jquery'), AUTO_LOAD_NEXT_POST_VERSION ); // TipTip - Auto_Load_Next_Post()->load_file( 'jquery-tiptip', '/assets/js/jquery-tiptip/jquery.tipTip' . AUTO_LOAD_NEXT_POST_SCRIPT_MODE . '.js', true, array('jquery'), Auto_Load_Next_Post()->version ); - + Auto_Load_Next_Post::load_file( 'jquery-tiptip', '/assets/js/libs/jquery-tiptip/jquery.tipTip'.AUTO_LOAD_NEXT_POST_SCRIPT_MODE.'.js', true, array('jquery'), AUTO_LOAD_NEXT_POST_VERSION ); // Variables for Admin JavaScripts - wp_localize_script( Auto_Load_Next_Post()->plugin_slug . '_admin_script', 'auto_load_next_post_admin_params', apply_filters( 'auto_load_next_post_admin_params', array( - 'plugin_url' => Auto_Load_Next_Post()->plugin_url(), + wp_localize_script( AUTO_LOAD_NEXT_POST_SLUG.'_admin_script', 'auto_load_next_post_admin_params', array( + //'plugin_url' => Auto_Load_Next_Post::plugin_url(), 'i18n_nav_warning' => __( 'The changes you made will be lost if you navigate away from this page.', 'auto-load-next-post' ), - 'plugin_screen_id' => AUTO_LOAD_NEXT_POST_SCREEN_ID, - ) ) ); + //'plugin_screen_id' => AUTO_LOAD_NEXT_POST_SCREEN_ID, + ) ); // Stylesheets - Auto_Load_Next_Post()->load_file( Auto_Load_Next_Post()->plugin_slug . '_admin_style', '/assets/css/admin/auto-load-next-post' . AUTO_LOAD_NEXT_POST_SCRIPT_MODE . '.css' ); - - Auto_Load_Next_Post()->load_file( Auto_Load_Next_Post()->plugin_slug . '_chosen_style', '/assets/css/chosen' . AUTO_LOAD_NEXT_POST_SCRIPT_MODE . '.css' ); - - } // END register_scripts_and_styles() + Auto_Load_Next_Post::load_file( AUTO_LOAD_NEXT_POST_SLUG.'_admin_style', '/assets/css/admin/auto-load-next-post'.AUTO_LOAD_NEXT_POST_SCRIPT_MODE.'.css' ); + Auto_Load_Next_Post::load_file( AUTO_LOAD_NEXT_POST_SLUG.'_chosen_style', '/assets/css/libs/chosen'.AUTO_LOAD_NEXT_POST_SCRIPT_MODE.'.css' ); + } // END admin_scripts() /** * Filters the admin footer text by placing links @@ -99,24 +137,23 @@ public function register_scripts_and_styles() { * @since 1.0.0 * @access public * @param $text - * @filter auto_load_next_post_admin_footer_review_text * @return string */ public function admin_footer_text( $text ) { $screen = get_current_screen(); - if ( in_array( $screen->id, auto_load_next_post_get_screen_ids() ) ) { + if ( $screen->id == 'settings_page_auto-load-next-post-settings' ) { - $links = apply_filters( 'auto_load_next_post_admin_footer_text_links', array( - Auto_Load_Next_Post()->web_url . '?utm_source=wpadmin&utm_campaign=footer' => __( 'Website', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), - Auto_Load_Next_Post()->doc_url . '?utm_source=wpadmin&utm_campaign=footer' => __( 'Documentation', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), - ) ); + $links = array( + 'http://autoloadnextpost.com/?utm_source=wpadmin&utm_campaign=plugin-settings-footer' => __( 'Website', 'auto-load-next-post' ), + 'https://github.com/seb86/Auto-Load-Next-Post/wiki/?utm_source=wpadmin&utm_campaign=plugin-settings-footer' => __( 'Documentation', 'auto-load-next-post' ), + ); $text = ''; $counter = 0; foreach ( $links as $key => $value ) { - $text .= '' . $value . ''; + $text .= ''.$value.''; if( count( $links ) > 1 && count( $links ) != $counter ) { $text .= ' | '; @@ -125,9 +162,7 @@ public function admin_footer_text( $text ) { } // Rating and Review - if ( apply_filters( 'auto_load_next_post_admin_footer_review_text', true ) ) { - $text .= sprintf( __( 'If you like %1$s please leave a ★★★★★ rating on WordPress.org. A huge thank you in advance!', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), Auto_Load_Next_Post()->name, Auto_Load_Next_Post()->wp_plugin_review_url ); - } + $text .= sprintf( __( 'If you like %1$s please leave a ★★★★★ rating on WordPress.org. A huge thank you in advance!', 'auto-load-next-post' ), 'Auto Load Next Post', 'https://wordpress.org/support/view/plugin-reviews/auto-load-next-post?filter=5#postform' ); return $text; } @@ -144,29 +179,28 @@ public function admin_footer_text( $text ) { * @since 1.0.0 * @access public * @param $text - * @filter auto_load_next_post_update_footer_links * @return string $text */ public function update_footer( $text ) { $screen = get_current_screen(); - if ( in_array( $screen->id, auto_load_next_post_get_screen_ids() ) ) { + if ( $screen->id == 'settings_page_auto-load-next-post-settings' ) { $text = ''; - $links = apply_filters( 'auto_load_next_post_update_footer_links', array( - AUTO_LOAD_NEXT_POST_GITHUB_REPO_URI . 'blob/master/CONTRIBUTING.md?utm_source=wpadmin&utm_campaign=footer' => __( 'Contribute', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), - AUTO_LOAD_NEXT_POST_GITHUB_REPO_URI . 'issues?state=open&utm_source=wpadmin&utm_campaign=footer' => __( 'Report Bugs', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), - ) ); + $links = array( + 'https://github.com/seb86/Auto-Load-Next-Post/blob/master/CONTRIBUTING.md?utm_source=wpadmin&utm_campaign=plugin-settings-footer' => __( 'Contribute', 'auto-load-next-post' ), + 'https://github.com/seb86/Auto-Load-Next-Post/issues?state=open&utm_source=wpadmin&utm_campaign=plugin-settings-footer' => __( 'Report Bugs', 'auto-load-next-post' ), + ); foreach( $links as $key => $value ) { - $text .= '' . $value . ''; + $text .= ''.$value.''; } - $text .= '' . '

'. + $text .= ''.'

'. '

'. - sprintf( __( '%s Version', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), Auto_Load_Next_Post()->name ). - ' : ' . esc_attr( Auto_Load_Next_Post()->version ) . '

'; + sprintf( __( '%s Version', 'auto-load-next-post' ), 'Auto Load Next Post' ). + ' : '.esc_attr( AUTO_LOAD_NEXT_POST_VERSION ).'

'; return $text; } diff --git a/includes/admin/class-auto-load-next-post-install.php b/includes/admin/class-auto-load-next-post-install.php index f7dfeb5..4250b53 100644 --- a/includes/admin/class-auto-load-next-post-install.php +++ b/includes/admin/class-auto-load-next-post-install.php @@ -27,9 +27,7 @@ class Auto_Load_Next_Post_Install { * @access public */ public function __construct() { - register_activation_hook( AUTO_LOAD_NEXT_POST_FILE, array( $this, 'install' ) ); register_deactivation_hook( AUTO_LOAD_NEXT_POST_FILE, array( $this, 'deactivate' ) ); - } // END __construct() /** @@ -42,7 +40,7 @@ public function install() { $this->create_options(); // Add plugin version - update_option( 'auto_load_next_post_version', Auto_Load_Next_Post()->version ); + update_option( 'auto_load_next_post_version', AUTO_LOAD_NEXT_POST_VERSION ); } // END install() /** diff --git a/includes/admin/settings/class-auto-load-next-post-settings-general.php b/includes/admin/settings/class-auto-load-next-post-settings-general.php index f91a87c..12036d0 100644 --- a/includes/admin/settings/class-auto-load-next-post-settings-general.php +++ b/includes/admin/settings/class-auto-load-next-post-settings-general.php @@ -28,12 +28,12 @@ class Auto_Load_Next_Post_Settings_General_Tab extends Auto_Load_Next_Post_Setti */ public function __construct() { $this->id = 'general'; - $this->label = __( 'General', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ); + $this->label = __( 'General', 'auto-load-next-post' ); - add_filter( 'auto_load_next_post_settings_submenu_array', array( $this, 'add_menu_page' ), 20 ); - add_filter( 'auto_load_next_post_settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); - add_action( 'auto_load_next_post_settings_' . $this->id, array( $this, 'output' ) ); - add_action( 'auto_load_next_post_settings_save_' . $this->id, array( $this, 'save' ) ); + add_filter( 'auto_load_next_post_settings_submenu_array', array( $this, 'add_menu_page' ), 20 ); + add_filter( 'auto_load_next_post_settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); + add_action( 'auto_load_next_post_settings_'.$this->id, array( $this, 'output' ) ); + add_action( 'auto_load_next_post_settings_save_'.$this->id, array( $this, 'save' ) ); } // END __construct() /** @@ -49,7 +49,7 @@ public function save() { $settings = $this->get_settings(); Auto_Load_Next_Post_Admin_Settings::save_fields( $settings, $current_tab ); - } + } // END save() /** * Get post types @@ -64,7 +64,7 @@ public function get_post_types() { $post_types = get_post_types( array( 'public' => true ), 'names' ); return $post_types; - } + } // END get_post_types() /** * Get settings array @@ -74,18 +74,18 @@ public function get_post_types() { * @return array */ public function get_settings() { - return apply_filters( 'auto_load_next_post_' . $this->id . '_settings', array( + return apply_filters( 'auto_load_next_post_'.$this->id.'_settings', array( array( - 'title' => __( 'Information', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), + 'title' => __( 'Information', 'auto-load-next-post' ), 'type' => 'title', - 'desc' => __( 'For the plugin to work you need to set the variables below.', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), - 'id' => $this->id . '_options' + 'desc' => __( 'For the plugin to work you need to set the variables below.', 'auto-load-next-post' ), + 'id' => $this->id.'_options' ), array( - 'title' => __( 'Restrict Post Types', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), - 'desc' => __( 'Select which post types you wish to load automatically.', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), + 'title' => __( 'Restrict Post Types', 'auto-load-next-post' ), + 'desc' => __( 'Select which post types you wish to load automatically.', 'auto-load-next-post' ), 'desc_tip' => true, 'id' => 'auto_load_next_post_get_post_types', 'class' => 'chosen-select', @@ -97,30 +97,19 @@ public function get_settings() { ), array( - 'title' => __( 'Content Container', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), - 'desc' => __( 'Example: div.single', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), + 'title' => __( 'Content Container', 'auto-load-next-post' ), + 'desc' => __( 'Example: main.site-main', 'auto-load-next-post' ), 'desc_tip' => true, 'id' => 'auto_load_next_post_content_container', - 'default' => 'div.single', + 'default' => 'main.site-main', 'type' => 'text', 'css' => 'min-width:300px;', 'autoload' => false ), - /*array( - 'title' => __( 'Post ID Selector', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), - 'desc' => __( 'Example: article', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), - 'desc_tip' => true, - 'id' => 'auto_load_next_post_id_selector', - 'default' => 'article', - 'type' => 'text', - 'css' => 'min-width:300px;', - 'autoload' => false - ),*/ - array( - 'title' => __( 'Post Title Selector', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), - 'desc' => __( 'Example: h1.entry-title', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), + 'title' => __( 'Post Title Selector', 'auto-load-next-post' ), + 'desc' => __( 'Example: h1.entry-title', 'auto-load-next-post' ), 'desc_tip' => true, 'id' => 'auto_load_next_post_title_selector', 'default' => 'h1.entry-title', @@ -130,8 +119,8 @@ public function get_settings() { ), array( - 'title' => __( 'Post Navigation Container', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), - 'desc' => __( 'Example: nav.post-navigation', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), + 'title' => __( 'Post Navigation Container', 'auto-load-next-post' ), + 'desc' => __( 'Example: nav.post-navigation', 'auto-load-next-post' ), 'desc_tip' => true, 'id' => 'auto_load_next_post_navigation_container', 'default' => 'nav.post-navigation', @@ -141,8 +130,8 @@ public function get_settings() { ), array( - 'title' => __( 'Comments Container', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), - 'desc' => __( 'Example: div#comments', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), + 'title' => __( 'Comments Container', 'auto-load-next-post' ), + 'desc' => __( 'Example: div#comments', 'auto-load-next-post' ), 'desc_tip' => true, 'id' => 'auto_load_next_post_comments_container', 'default' => 'div#comments', @@ -152,35 +141,43 @@ public function get_settings() { ), array( - 'title' => __( 'Remove Comments', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), - 'desc' => __( 'Enable to remove comments when each post loads.', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), + 'title' => __( 'Remove Comments', 'auto-load-next-post' ), + 'desc' => __( 'Enable to remove comments when each post loads.', 'auto-load-next-post' ), 'id' => 'auto_load_next_post_remove_comments', 'default' => 'yes', 'type' => 'checkbox' ), array( - 'title' => __( 'Update Google Analytics', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), - 'desc' => __( 'Enable to update your Google Analytics each time a post is automatically loaded.', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), + 'title' => __( 'Update Google Analytics', 'auto-load-next-post' ), + 'desc' => __( 'Each time a post is loaded it will count as a pageview. You must have a reference to your Google Analytics tracking code on the page.', 'auto-load-next-post' ), 'id' => 'auto_load_next_post_google_analytics', 'default' => 'no', 'type' => 'checkbox' ), array( - 'title' => __( 'Remove all data on uninstall?', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), - 'desc' => __( 'If enabled, all settings for this plugin will all be deleted when uninstalling via Plugins > Delete.', AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ), + 'title' => __( 'Reset all data?', 'auto-load-next-post' ), + 'desc' => __( 'Press the reset button to clear all settings for this plugin and re-install the default settings.', 'auto-load-next-post' ), + 'id' => 'auto_load_next_post_uninstall_data', + 'default' => 'no', + 'type' => 'reset_data' + ), + + array( + 'title' => __( 'Remove all data on uninstall?', 'auto-load-next-post' ), + 'desc' => __( 'If enabled, all settings for this plugin will all be deleted when uninstalling via Plugins > Delete.', 'auto-load-next-post' ), 'id' => 'auto_load_next_post_uninstall_data', 'default' => 'no', 'type' => 'checkbox' ), - array( 'type' => 'sectionend', 'id' => $this->id . '_options'), + array( 'type' => 'sectionend', 'id' => $this->id.'_options'), )); // End general settings - } + } // END get_settings() } -} // end if class exists +} // END if class exists return new Auto_Load_Next_Post_Settings_General_Tab(); diff --git a/includes/admin/settings/class-auto-load-next-post-settings-page.php b/includes/admin/settings/class-auto-load-next-post-settings-page.php index 3b59d5c..c52a338 100644 --- a/includes/admin/settings/class-auto-load-next-post-settings-page.php +++ b/includes/admin/settings/class-auto-load-next-post-settings-page.php @@ -92,7 +92,7 @@ public function output_sections() { foreach ( $sections as $id => $label ) { $output .= '
  • ' . $label . ' ' . ( end( $array_keys ) == $id ? '' : '|' ) . '
  • '; + $output .= '" class="'.( $current_section == $id ? 'current' : '' ).'">'.$label.' '.( end( $array_keys ) == $id ? '' : '|' ).' '; } $output .= '
    '; @@ -117,6 +117,7 @@ public function output_sections() { */ public function output() { $settings = $this->get_settings(); + Auto_Load_Next_Post_Admin_Settings::output_fields( $settings ); } // END output() @@ -136,7 +137,7 @@ public function save() { Auto_Load_Next_Post_Admin_Settings::save_fields( $settings, $current_tab, $current_section ); if ( $current_section ) { - do_action( 'auto_load_next_post_update_options_' . $this->id . '_' . $current_section ); + do_action( 'auto_load_next_post_update_options_'.$this->id.'_'.$current_section ); } } // END save() diff --git a/includes/admin/settings/class-auto-load-next-post-settings-support.php b/includes/admin/settings/class-auto-load-next-post-settings-support.php new file mode 100644 index 0000000..6087dd2 --- /dev/null +++ b/includes/admin/settings/class-auto-load-next-post-settings-support.php @@ -0,0 +1,92 @@ +id = 'support'; + $this->label = __( 'Support', 'auto-load-next-post' ); + + add_filter( 'auto_load_next_post_settings_submenu_array', array( $this, 'add_menu_page' ), 20 ); + add_filter( 'auto_load_next_post_settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); + add_action( 'auto_load_next_post_settings_'.$this->id, array( $this, 'output' ) ); + } // END __construct() + + /** + * Output the settings + * + * @since 1.4.3 + * @access public + */ + public function output() { + $settings = $this->get_settings(); + + Auto_Load_Next_Post_Admin_Settings::output_fields( $settings ); + } // END output() + + /** + * Callback + * + * @since 1.4.3 + * @access public + * @return string + */ + public function callback() { + return '

    '.__( 'As this is a free plugin, I can not provide support.', 'auto-load-next-post' ).'

    '. + '

    '.sprintf( __( 'You may ask the WordPress community for help by posting to the WordPress.org support forum. Response time can range from a few days to a few weeks and will likely be from a non-developer.', 'auto-load-next-post' ), 'https://wordpress.org/support/plugin/auto-load-next-post' ).'

    '. + '

    '.sprintf( __( 'If you want a timely response via email from me, upgrade and then send me an email.', 'auto-load-next-post' ), 'https://www.sebastiendumont.com/plugins/auto-load-next-post/?utm_source=insideplugin&utm_medium=web&utm_content=support-tab&utm_campaign=freeplugin-alnp' ).'

    '. + '

    '.sprintf( __( 'If you\'ve found a bug, please submit an issue on GitHub.', 'auto-load-next-post' ), 'https://github.com/seb86/Auto-Load-Next-Post/issues' ).'

    '. + '

    '.__( 'Thank you.', 'auto-load-next-post' ).'

    '; + } // END callback() + + /** + * Get settings array + * + * @since 1.4.3 + * @access public + * @param $current_section + * @return array + */ + public function get_settings() { + return array( + + array( + 'title' => __( 'Support', 'auto-load-next-post' ), + 'type' => 'title', + 'desc' => $this->callback(), + 'id' => 'auto_load_next_post_support_tab' + ), + + array( + 'type' => 'sectionend', + 'id' => 'auto_load_next_post_support_tab' + ), + + ); + } // END get_settings() +} + +} // END if class exists + +return new Auto_Load_Next_Post_Settings_Support_Tab(); diff --git a/includes/admin/views/html-admin-settings.php b/includes/admin/views/html-admin-settings.php index 100d01c..aa87294 100644 --- a/includes/admin/views/html-admin-settings.php +++ b/includes/admin/views/html-admin-settings.php @@ -4,25 +4,23 @@ */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly. ?> -
    +

    - - - +

    diff --git a/includes/admin/views/html-notice-requirement-wp.php b/includes/admin/views/html-notice-requirement-wp.php new file mode 100644 index 0000000..2cb2e35 --- /dev/null +++ b/includes/admin/views/html-notice-requirement-wp.php @@ -0,0 +1,10 @@ + +
    +

    %s requires WordPress %s or higher. Please upgrade your WordPress setup.', 'auto-load-next-post'), 'Auto Load Next Post', AUTO_LOAD_NEXT_POST_WP_VERSION_REQUIRE ); ?>

    +
    diff --git a/includes/admin/views/html-notice-theme-support.php b/includes/admin/views/html-notice-theme-support.php index f44039d..a00ea3a 100644 --- a/includes/admin/views/html-notice-theme-support.php +++ b/includes/admin/views/html-notice-theme-support.php @@ -6,6 +6,6 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
    -

    The theme you are using has not declared support for %s – please read the integration guide.', Auto_Load_Next_Post()->name ), AUTO_LOAD_NEXT_POST_TEXT_DOMAIN ); ?>

    -

    +

    The theme you are using has not declared support for %s – please read the integration guide.', 'Auto Load Next Post' ), 'auto-load-next-post' ); ?>

    +

    diff --git a/includes/admin/wp-update-php/WPUpdatePhp.php b/includes/admin/wp-update-php/WPUpdatePhp.php new file mode 100644 index 0000000..ad8c84a --- /dev/null +++ b/includes/admin/wp-update-php/WPUpdatePhp.php @@ -0,0 +1,50 @@ +minimum_version = $minimum_version; + } + + /** + * @param $version + * + * @return bool + */ + public function does_it_meet_required_php_version( $version ) { + if ( $this->is_minimum_php_version( $version ) ) { + return true; + } + + $this->load_minimum_required_version_notice(); + return false; + } + + /** + * @param $version + * + * @return boolean + */ + private function is_minimum_php_version( $version ) { + return version_compare( $this->minimum_version, $version, '<=' ); + } + + /** + * @return void + */ + private function load_minimum_required_version_notice() { + if ( is_admin() && ! defined( 'DOING_AJAX' ) ) { + add_action( 'admin_notices', array( $this, 'admin_notice' ) ); + } + } + + public function admin_notice() { + echo '
    '; + echo '

    '.sprintf( __( 'Unfortunately, %s can not run on PHP versions older than '. $this->minimum_version .'. Read more information about how you can update'), 'Auto Load Next Post').'.

    '; + echo '
    '; + } +} diff --git a/includes/auto-load-next-post-conditional-functions.php b/includes/auto-load-next-post-conditional-functions.php index 070cc16..1c18c78 100644 --- a/includes/auto-load-next-post-conditional-functions.php +++ b/includes/auto-load-next-post-conditional-functions.php @@ -25,6 +25,31 @@ function auto_load_next_post_is_ajax() { if ( defined( 'DOING_AJAX' ) ) { return true; } + return ( isset( $_SERVER['HTTP_X_REQUESTED_WITH'] ) && strtolower( $_SERVER['HTTP_X_REQUESTED_WITH'] ) == 'xmlhttprequest' ) ? true : false; } // END auto_load_next_post_is_ajax } + +if ( ! function_exists( 'supports_alnp' ) ) { + /** + * Returns true or false if the plugin is supported by the theme. + * + * @since 1.4.3 + * @access public + * @return boolen + */ + function supports_alnp(){ + /* WordPress core themes. */ + $core_themes = array( + 'twentyfifteen', 'twentyfourteen', 'twentythirteen', 'twentytwelve', 'twentyten' + ); + + if ( in_array( get_option('template'), $core_themes ) ) { + return true; + } else if ( current_theme_supports('auto-load-next-post') ) { + return true; + } + + return false; + } // END supports_alnp() +} diff --git a/includes/auto-load-next-post-core-functions.php b/includes/auto-load-next-post-core-functions.php index 6afca86..0255a95 100644 --- a/includes/auto-load-next-post-core-functions.php +++ b/includes/auto-load-next-post-core-functions.php @@ -27,16 +27,17 @@ function auto_load_next_post_template_redirect() { if ( ! isset( $wp_query->query_vars['partial'] ) || ! is_singular() ) return; - // Load file from theme if one exists. - $template_path = get_stylesheet_directory() . '/' . Auto_Load_Next_Post()->template_path(); - if ( file_exists ( $template_path . 'content-partial.php' ) ) { - include ( $template_path . 'content-partial.php' ); - } + /** + * Load the template file from theme if one exists. + * If theme does not have a template file, load default from the plugin. + */ + $template_path = get_stylesheet_directory().'/'.AUTO_LOAD_NEXT_POST_TEMPLATE_PATH; + $default_path = AUTO_LOAD_NEXT_POST_FILE_PATH; - // If theme does not have the file, load default from plugin. - $default_path = Auto_Load_Next_Post()->plugin_path(); - if ( file_exists ( $default_path . '/template/content-partial.php' ) ) { - include ( $default_path . '/template/content-partial.php' ); + if ( file_exists ( $template_path.'content-partial.php' ) ) { + include ( $template_path.'content-partial.php' ); + } else if ( file_exists ( $default_path.'/template/content-partial.php' ) ) { + include ( $default_path.'/template/content-partial.php' ); } exit; diff --git a/languages/auto-load-next-post-de_DE.mo b/languages/auto-load-next-post-de_DE.mo new file mode 100644 index 0000000000000000000000000000000000000000..5be05188c5fc48541c18f4b89f0bd3c58a17696b GIT binary patch literal 5222 zcmai%OKeO1F- z&Ns~u z=lA~p`OE$HzM1eedB4v4!+VnC5_sRo`NMPg-X!@V_#pUM@NsYkJOh3jTmt97XTkfy z*TFA=KdA9%psfET_&M-hQ11FIcoh5qd=z~66G?IsTmcV(7F+<|0Ph2T4Sovz9VqAh z0Tj9Z3U8-vwpg-@!FdHp}<3AR;9hDE8R`#g5+r4ftd5F=FN(gcSRqWRckE5W#>e zk|Ut__XPM5cpcp%OX1fdqx7$cA6$3fm zt4jr!7^__zDy<2->Sj3{7A`Pi1B(uQD0l7 zvrbCZKg#qFlSgj|2fBAabD zjNL5UAkMWC8IAVI%bu|!|EO?VYPTqr)w(MKUWd43J99>q z^s24%V$@)7i9s{fE_)Y~D;gVSd2%&#U3JM7!;8sP)5RivF8u_Q|V}@?kSb! zxttt*st~AJIIP4N8D?cgTdS_lbwHA6NBm=bV1`go+a|-+BDYr;)Jj~}kV{1RO*58F zjSNCqwdjK@Z12J`zu2sQ#+9ASs*clHAV3syZlSLny_l&!A$0!eF@N;J70xKz%6MOD z_GcFwYSsD@bIN7x##Dsafju3o?STKeN$86J2w&#nof=<{q6=kQkFx;IAArCExs`{-_F>>*;X* z=teu|%%c~MKl1e1C!bvSD2OUJq6Y_{*1p1bJ@Dnib#IV_zEQYdWws^NFUiF))`ECc zS$8|L9epHO+mFrUdA$?roH2Im-s3KFZXvlLN%Z_Ax~Fn8&a6vvP%LuY35Bax@8?2- zEZe3iqdCdNcy3;u>xx&|BRW;SX6W^1m-?w>5>*^Q+q!+df_E zrggDzsU`GL*C?MVMuu2zrZQ-H-SPEU;&@tRFN7iPQ+cP&_SWhoWIUsA(6((A0es=D3IyalnJ+0=>wC3lZn4O=UWnuav z(IlPdF6+*n^jNYYNvQI@=5xv|Uk)1A5j#KZAVLShpNdHbmwNGuMcN z5_6{OIvcdq6;0W;>O_URC)Ej26g@|yQ6tC&W>fD(bw|TA4savl`KH7|Dy=8AWK}xE zc1=<~p5E;0jg{5r$(ieG*H`z=J=d6>sT*LrPK32oU~3aw8M`1M;&9*jm)0+*=l0i$ z5S!YitCk){WVO_}wh0qOT2wXen!) zdbH+F%`a@&3MQi)wkU@6)YR_|D?6>HI;Y~M9a+GT9{;dAlR3LnZL8Mq3v-ij?`RTR zjMh?>)n37`JE2RG8k^SH*iyUNPwms0>-2A+Tsn(-GZi)3I!KLHr6*DyN|dunoi9R* z_I}dVF7l(TiXZ8IPGRZvbArm!Xy`uV?^YU*;~J@%kz@VO32U~W`?+fA=)!p!mgPDaYLdZLF{|B!F4qd?;?Xn5-Brr(ZR8 zgh^-?9&#buDACr6v!D$xKtHhY*sg&_;NWf}?ZmM36|D{gU$t$lPjuselpk}p7+^h} z@4bT<1W~+60*)1&NBtHuFd;HiG)CAQE4KFDv9hw>qt+|7hO;q>=lH=CA*oo~RahGb z6HS=PMfSpNPSZX2Qvgz1pW4>jkh6m_?XRzIIe5vE&GE0q`D^sF>jqMVK%rtgRf^%O z4qVc->sv&Z+FQQBVKyrg_gDy*9l%$VeQ_GJ}vA(T9_-`Jdef5xN zFdWm@WKwGQUrb$sB*ipdsuI#fTRZ+MQb&C3zN(6MNyysg1D#8vtxjicH5Ln0B{?mZ z|2J|Fk+b)zV&&}C@X fn{v~gr14;fno!6!GU|@UMM literal 0 HcmV?d00001 diff --git a/languages/auto-load-next-post-de_DE.po b/languages/auto-load-next-post-de_DE.po new file mode 100644 index 0000000..593fcd4 --- /dev/null +++ b/languages/auto-load-next-post-de_DE.po @@ -0,0 +1,277 @@ +# Auto Load Next Post Copyright (c) {2014} +# Translators: +# Bettina , 2015 +# Merlin Schumacher , 2015 +msgid "" +msgstr "" +"Project-Id-Version: Auto Load Next Post\n" +"Report-Msgid-Bugs-To: https://github.com/seb86/WordPress-Plugin-Boilerplate/issues\n" +"POT-Creation-Date: 2015-10-19 16:22+0200\n" +"PO-Revision-Date: 2015-10-19 18:57+0200\n" +"Last-Translator: Sebastien D \n" +"Language-Team: German (Germany) (http://www.transifex.com/wp-translations/auto-load-next-post/language/de_DE/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: de_DE\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 1.8.5\n" +"X-Poedit-Basepath: ..\n" +"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c;_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Textdomain-Support: yes\n" +"X-Poedit-SearchPath-0: .\n" + +#: auto-load-next-post.php:84 auto-load-next-post.php:96 +msgid "Cheatin’ huh?" +msgstr "" + +#: includes/admin/class-auto-load-next-post-admin-help.php:47 includes/admin/class-auto-load-next-post-admin.php:78 includes/admin/class-auto-load-next-post-admin.php:149 +msgid "Documentation" +msgstr "Dokumentation" + +#: includes/admin/class-auto-load-next-post-admin-help.php:49 +#, php-format +msgid "Thank you for using %1$s :) Should you need help using %1$s please read the documentation." +msgstr "" + +#: includes/admin/class-auto-load-next-post-admin-help.php:50 +#, php-format +msgid "%s Documentation" +msgstr "%s Dokumentation" + +#: includes/admin/class-auto-load-next-post-admin-help.php:55 +msgid "Found a bug?" +msgstr "Einen Fehler gefunden?" + +#: includes/admin/class-auto-load-next-post-admin-help.php:57 +#, php-format +msgid "If you find a bug within %s you can create a ticket via Github issues. Ensure you read the contribution guide prior to submitting your report. Be as descriptive as possible. Thank you." +msgstr "Wenn Sie einen Bug in %s finden können Sie ein Ticket bei unserem GitHub Bugtracker einreichen. Bitte lesen Sie bevor Sie einen Bug einreichen unsere Anleitung zur Mitarbeit. Bitte beschreiben Sie den Fehler so genau wie möglich. Vielen Dank!" + +#: includes/admin/class-auto-load-next-post-admin-help.php:58 +msgid "Report a bug" +msgstr "Einen Fehler melden." + +#: includes/admin/class-auto-load-next-post-admin-help.php:62 +msgid "For more information:" +msgstr "Weitere Informationen:" + +#: includes/admin/class-auto-load-next-post-admin-help.php:63 +#, php-format +msgid "About %s" +msgstr "Ãœber %s" + +#: includes/admin/class-auto-load-next-post-admin-help.php:64 +msgid "Project on WordPress.org" +msgstr "Projekt auf Wordpress.org" + +#: includes/admin/class-auto-load-next-post-admin-help.php:65 +msgid "Project on Github" +msgstr "Projekt auf Github" + +#: includes/admin/class-auto-load-next-post-admin-menus.php:46 +#, php-format +msgid "%s Settings" +msgstr "%s Einstellungen" + +#: includes/admin/class-auto-load-next-post-admin-settings.php:58 +msgid "Action failed. Please refresh the page and retry." +msgstr "Aktion fehlgeschlagen. Bitte aktualisieren Sie die Seite und versuchen es erneut." + +#: includes/admin/class-auto-load-next-post-admin-settings.php:66 +msgid "Your settings have been saved." +msgstr "Ihre Einstellungen wurden gespeichert." + +#: includes/admin/class-auto-load-next-post-admin-settings.php:135 includes/admin/class-auto-load-next-post-admin.php:123 +msgid "The changes you made will be lost if you navigate away from this page." +msgstr "Beim Verlassen der Seite werden deine Änderungen verworfen." + +#: includes/admin/class-auto-load-next-post-admin-settings.php:486 +msgid "Hard Crop?" +msgstr "Harter Beschnitt?" + +#: includes/admin/class-auto-load-next-post-admin-settings.php:508 +msgid "Select a page…" +msgstr "Wählen Sie eine Seite …" + +#: includes/admin/class-auto-load-next-post-admin.php:52 +msgid "Upgrade to Premium" +msgstr "" + +#: includes/admin/class-auto-load-next-post-admin.php:53 +msgid "Settings" +msgstr "Einstellungen" + +#: includes/admin/class-auto-load-next-post-admin.php:54 includes/admin/settings/class-auto-load-next-post-settings-support.php:29 includes/admin/settings/class-auto-load-next-post-settings-support.php:75 +msgid "Support" +msgstr "Support" + +#: includes/admin/class-auto-load-next-post-admin.php:79 +msgid "Community Support" +msgstr "Unterstützung durch die Community." + +#: includes/admin/class-auto-load-next-post-admin.php:148 +msgid "Website" +msgstr "Website" + +#: includes/admin/class-auto-load-next-post-admin.php:165 +#, php-format +msgid "If you like %1$s please leave a ★★★★★ rating on WordPress.org. A huge thank you in advance!" +msgstr "Wenn Sie %1$s mögen, hinterlassen Sie bitte eine ★★★★★-Bewertung auf WordPress.org. Dafür herzlichen Dank im Voraus." + +#: includes/admin/class-auto-load-next-post-admin.php:192 +msgid "Contribute" +msgstr "Etwas beitragen" + +#: includes/admin/class-auto-load-next-post-admin.php:193 +msgid "Report Bugs" +msgstr "Fehler melden" + +#: includes/admin/class-auto-load-next-post-admin.php:202 +#, php-format +msgid "%s Version" +msgstr "Version %s" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:31 +msgid "General" +msgstr "Allgemein" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:80 +msgid "Information" +msgstr "Information" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:82 +msgid "For the plugin to work you need to set the variables below." +msgstr "Damit das Plugin funktioniert müssen Sie die Variablen unten bestücken." + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:87 +msgid "Restrict Post Types" +msgstr "Beitragstypen einschränken." + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:88 +msgid "Select which post types you wish to load automatically." +msgstr "Wählen Sie welche Arten von Posts automatisch geladen werden sollen." + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:100 +msgid "Content Container" +msgstr "Container für Inhalte" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:101 +msgid "Example: main.site-main" +msgstr "" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:111 +msgid "Post Title Selector" +msgstr "Selektor für Beitragstitel" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:112 +msgid "Example: h1.entry-title" +msgstr "Beispiel: h1.entry-title" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:122 +msgid "Post Navigation Container" +msgstr "Container für die Artikelnavigation" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:123 +msgid "Example: nav.post-navigation" +msgstr "Beispiel: nav.post-navigation" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:133 +msgid "Comments Container" +msgstr "Container für die Kommentare" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:134 +msgid "Example: div#comments" +msgstr "Beispiel: div#comments" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:144 +msgid "Remove Comments" +msgstr "Kommentar entfernen" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:145 +msgid "Enable to remove comments when each post loads." +msgstr "Das Entfernen von Kommentaren aktivieren beim Laden jedes Posts." + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:152 +msgid "Update Google Analytics" +msgstr "Google Analytics aktualisieren" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:153 +msgid "Each time a post is loaded it will count as a pageview. You must have a reference to your Google Analytics tracking code on the page." +msgstr "" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:160 +msgid "Reset all data?" +msgstr "" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:161 +msgid "Press the reset button to clear all settings for this plugin and re-install the default settings." +msgstr "" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:168 +msgid "Remove all data on uninstall?" +msgstr "Alle Daten bei einer Deinstallation löschen?" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:169 +msgid "If enabled, all settings for this plugin will all be deleted when uninstalling via Plugins > Delete." +msgstr "Wenn diese Option aktiviert wird, werden alle Einstellungen dieses Plugins beim deinstallieren gelöscht." + +#: includes/admin/settings/class-auto-load-next-post-settings-support.php:56 +msgid "As this is a free plugin, I can not provide support." +msgstr "" + +#: includes/admin/settings/class-auto-load-next-post-settings-support.php:57 +#, php-format +msgid "You may ask the WordPress community for help by posting to the WordPress.org support forum. Response time can range from a few days to a few weeks and will likely be from a non-developer." +msgstr "" + +#: includes/admin/settings/class-auto-load-next-post-settings-support.php:58 +#, php-format +msgid "If you want a timely response via email from me, upgrade and then send me an email." +msgstr "" + +#: includes/admin/settings/class-auto-load-next-post-settings-support.php:59 +#, php-format +msgid "If you've found a bug, please submit an issue on GitHub." +msgstr "" + +#: includes/admin/settings/class-auto-load-next-post-settings-support.php:60 +msgid "Thank you." +msgstr "" + +#: includes/admin/views/html-admin-settings.php:23 +msgid "Save Changes" +msgstr "Änderungen speichern" + +#: includes/admin/views/html-notice-requirement-wp.php:9 +#, php-format +msgid "Sorry, %s requires WordPress %s or higher. Please upgrade your WordPress setup." +msgstr "" + +#: includes/admin/views/html-notice-theme-support.php:10 +msgid "Supporting your theme" +msgstr "Unterstützt ihr Theme" + +#: includes/admin/views/html-notice-theme-support.php:10 +msgid "Hide this notice" +msgstr "Diesen Hinweis ausblenden" + +#: includes/admin/wp-update-php/WPUpdatePhp.php:47 +#, php-format +msgid "Unfortunately, %s can not run on PHP versions older than " +msgstr "" + +#: template/content-partial.php:53 +msgid "Post navigation" +msgstr "Beitragsnavigation" + +#: template/content-partial.php:55 +msgctxt "Previous post link" +msgid "←" +msgstr "←" + +#: template/content-partial.php:56 +msgctxt "Next post link" +msgid "→" +msgstr "→" diff --git a/languages/auto-load-next-post-fr_FR.mo b/languages/auto-load-next-post-fr_FR.mo index f887f827f36a6c781b91f09f78ce0e1ef85d82c9..2c38f50b7bf2bccb44721a07a5a9db52e6db1411 100644 GIT binary patch literal 8025 zcmbuE+m9UCUB_#~ZbAk^$U?{xE_-aRZ|roB$6oJxdwgN+wRgR-m%%gZY+f>{?mpdJ zc6C*|E6b6QA!n zRekY}od;U3`Bt4e=hW|hIsW%2AODkp-vzE;<$C;WL9hva=co9?@7xnX@bln{;Lm`s zf=l3S@Tb8LTm|od&w+mqz8m~H_$2sE@IBxUDt!Cf{racCcQJkh{1mtfu7H0J9tQsl zd`M@pT3a!7HHN{}m|y{t0{v{5q(4{{#LS_+yZN z!BY?^I-lW>-mik%cfA^a9n^Q*;0xd`DEa;k_!00QK=Jo}gr<3i!HERBj^&bPj0)7hob-jm}C(-piQ1pC~$)fMiK<)d*>iJ9H8J;KL zE$~O+A@EfeNe(fn?|mBlMer{`t^X1TNx?sYe+PaAl)OK|q!Zv*!QTLXSm7a;FL}AX57fLP;3vR~VDMNF{0sOEZYL1+Y49&mj=uXWn@Are zh=~Qi4~maJ1f{PxEBrF}S)RWQYThm%k)D4Kl%78e>br09M|SwHpyc-0uXub9c#`Ks zpaDMsYX2CN-2WK73GRdM1b+nn4)_>O_&E46Q1kx){2cfNP;{JS@VCM9;D^D_fKP+p z1x4Sx*j#q=H24H^H~~t&O(yXeNIa5X{S(bcxEl2Uc!rBG;QX&1KF!Squ2WpHBl#$w z49;@tCz_=<{hA(v=Rw1T={jGOy!4Zu=-2WPV1Di=KI-2pH!pBK%LNP0HYF$7%poqs zHT|9EPCAvmQCD!3i*Vz9m}&50b&u%;n0;`LOSY+>WGa0g*8{&}Tx;&m%X67~MDJuM zJARH!@(qsW=B2b#4sB9|MU*BQ*tA6vCH-9Yw{4bdc)gvLg*loB>m5xqy)cSxw`n$F z8|KzzwwKv_V2Xh?qp)vHm~V3EzMVFzlXA(Wa?nirxjPQ$M4ny4^4Q5>62TC!Its>RYcvO7)lp|mu^lKF#h zthF$1Gn;g*DN?hSmYI1uP5ZGm>q!{z6;TJ~v#@g)d9ooKBD-2h&ERShwwcS)%nnmF z?9^=T3~XYoh;-D6w4C|7;cyh&mN~DzE_S2wk$T1X6*u(Yl)-8fiDY|?A}V70kV!)X z+RUTEHgxxpNl7?vik1d9QQsL$J@Zu& z^`5a#nB8R)qC9qXHf$isPxMCTRjV0oYq~bJ1(Y~pV@gS0@J6Z{Mi~E*w6ZAHMi9 zdz5VqFfT3Z!;4LGHOWiFsgJQ5QQ=k#YdToEvupWczeE~Zh#N&>7r~b8VdNyBO)_?I zZe=b*NDkk5CyPc!BooeMVR?k~n`UbeCQd_BUgPL4pRUbO%(!FRPuEym+Ws5dj|Wg?)H-Hb(c^g7d8X9^MlrtwPIcFYCWXTBA@ zW_O913R_s~-N%n*VV1208ya|R>Ya08(7oAG1R%J_wo{~;pFQ*Cz{%2C8p6O%37Un1 zRcbmAn?2gAe7J8^9^`iE+Fn@3#ncm<`ocI$OJ{I3<*}zcOYcBc#WLQ&-08@IqJvvL zP}cdNewIgf!y?ocQ%}CcTiLz2T$0VIdlyuA5RdgLO+?KRBzRHnjcgul%CN6sOnp5# zxnViV1;+-KI5AqQM|TEM9jOZ~b)LHuDIumVt(dSZQU%5ipCl)4)+u%~&9XgAtM;%t z|H|yWGC~(-Dgg4Y!M_Jle_*p|?yW4*JNj%c{FNiVROQAB0C;(n>RUT|QEj2>~~Lh*ax}BP$cx%El`jX6$PmWE*#_vIQ;}ygtI5 z>|3%qg< zT1B_IERvGSp^tSKtdCf(h!Izr4AqN-I?L|h4|`M}DK@L89c%AW%MhSkb)&#e;6uDF z(1ny?Nuz7WFRj(vo+& z#?8DRbsKWS##Y)ggQ6Jat(BF&OMOkmvy$8Px#w4=Y&U%NZCp;NGqX{QE>?VoT-x}p zt;Q84RdQeBC0?}5=~Js`8>^=pt1p_>=Ub;wKYQx*sZ&gB+#=$rem!8`xz^bi{Ja|> zRm~RS%lS;2wam3Q%;m{`qH^PWZ@2xMJEI0goO{h)F5z5Ux`DV$tgf+T!y#)_1rE%K zYfS9eljekYgvFhmou*qH_3WT@EQqWy)i;;E96YK`ARR_zIJQnMZ$x>~GTYm0+jebx8|y8^Mr(EX^xAgfVLG~< zr0J-7HFw`(W~cRBXW1><)dYrYeUt1?-zB?#nV&l&W)nm2Si-zy)-qmbZ=luPqD#n* zl13FeTV~JZbL&WooxujoHBQ0a(qe-_jiqks)?~jQVL z3~Z-qZrhUX!`{cAds#U7>&_s`OziWHA!lWieTtrNPfqHJe?zg7AItK4Wx5vPQKnlx zl!-NPVH0_PA#4>TVQSgju@vB{N3ujcS=k{J=5^z>9;X?RkOIbiM8qjEl5mbC?R>PR zR!m)%B|PxXQJ{{DM5T(q9BLGDeaOSMC;Jbs(DKp^s)V)KqU3^g8SuSQ6hhv;@;Ky$ z8L5-%g)HsNyFb}C9m{8OIs<)c#CJR~q<_jdmP3cj3g)(I4u!V+CLE_ovno?qp}7dO zH`(`1+~f;poEDVcu2*A+yo|aJCn=jHwAUhja359|02m@4Z&sP8*qDtY%|-QR{X1+f7cAD?Rg zbJL>6KGu6=2^rAj(4qdpz> z%qnM|hHWJ1Gc0$h>N;UJ!~e{s;ASYX*E&<%*rOVAXC9l82_b2WXDyR3;Y1W*7nSdh z#D>@Pj14RgNAS~~!lU72Uxx^|k9UDC&y}gU@3`jTYVD9}EEQQYIuKkL8k{g_BuiPU zjNb9uC2Y@Xvbp-uO@}ni?kFl`S~S;Xiiw2|gLu=9Ctn;g?wii4ZKCtc?EQvU#&Pc> zafuKXm%Bbwyv=u?z5$}gBJLcw$v7o2RX&u3{xHXEGKlY$cm&I<-m~WngZSrr@H zXYBsJno#-nPuOZ&sm$6>jFTYiI>4+0r$|z@ zfcN7=Qw9;U!n;CGU23B}U(6vgootNgx7=Y2O^xMfC3;vFI#d9hK5Vwic{G>p!V9+2y2{fJ)|S8TF`~uFl#O)3m?IQ&B?wRP?tVR ztX08w_V%?|_bMN%vs$%weKaa%Ng@Q})R82KiiyZC;v_H%<0$ur;9RzHOYGzTr=Ht? z=F~pFR!)2HI_U<_rn%*q^4MJeN~=2+kgt#Z$bzM~e$2VNi!lr7a~cgqZh@1^fxBr! zG}FT)0?Q?g%ZEdS0Mz-G=Ua0U@_aq`fjYg@SfCS*xKNA;@D1%$MLCC-ne9`#)scEg zHCcyJ`ed(PDh>|qoRKd!%nPp%+TVo*7m5h^gOG}a@a8fjXAo5vO(554@T|NFULw|} z@nruIt+eGJV5$q(N|(yiq>2b@oGZNKR4|WI-BIB81;Iif$9ASWalnnsqHxZBavZNB zwpvyU6mNr@)<=Z0h%iwEQ+xi=h4`i>yUGK!S@-GA@{}_ygzut)sG07dX46Ujp}WmI zn(9n-$pihjBdQtPK*28-;!4oE5+LGHiH>c@SxnWC%d^#=Q&dz+a!Ns%3;KDmG7C0Bmm5$;-Jx&7fuT(g zZj0n9XLdQFOZdcGAaG(v?~C=TW=z#B4Ufup94X_;;pY+shj@e~*Q8I2aGk!pZRaI-*qZFCh_9LJw6x9MJd+l#4NKAUaJw!7WCIXAYou*@77&Q|P?h&Y~m?sn|nd#>kY zITIHs1u-go5(x?d6*MBMu@LK@+#i;IR743Th?PN5SP+EL3w?ffSIAy|>^Yz3dCqfw z&+p}XcX8-SV*2vRMMo6Y%cy63QKZx`oVkq$_VyyBmcw^o1w0GO;U{o0ya*HU8@LbF zlqgjVUxX{+F}MQ0SKvobzW)kVDK)LWW75gSFK`5|FIB1mhOh}9h8oVnJK+Vm0saPS zVRM;M18@LV!lxjA>JSgPXa-6GM`044gg?M4qW_Hh)eR<++4&_44lh9Y;77O`{sASU zRd`zl+o0?ZK*{V;csm>~ynhBt0xv=F`xcbI&Oq^VuCTrYYq?*2&qT`qCzO(I;wy1* zFC=XSt5;28X=SgA=U7p90>0^i4jE7bFa^$|GT&Bh5P zGw>o54Wvk4GCT<7g4bXToP*-vJfwH(OE?U_g((=L9P8oB@Gf{7w!p99-Ec92=!D&H z4YXHM{}Cn!*pLf8E$}KNId!9Ou!J-YveuFg0zD3|Fg?LXa_(8mgB;XhD4KZ%Ho^~} zRPu6xze72n8qQ+P{#_Kg_`v|6o*%#l)9MmJOmpdGEp9s z_fwD`ggRPSzY3+*XW&lQ&!y|&%rq0}`I}HmGzUpgZDNQ?c4CrMj3IsQWzbsH&Y(bw zR_9HMBSDBs+389?xenRDq_tv88FWOoF{an@kW8g-`~vgV!&CY!CRs`;30#qM-XwDQ zDYi1CYGP7W(Zo%o()o(XTC^ldigh!jLQAA>Xl*ZgyOU6OK-Lc9e0lp%uDbcCgbLYS$^x*Qvk+p@l|E73b( zE|rX#)1~q0thFnR4^KzAq!s2p`}#r88)tWO)=E!>t{rH{vL|%tW*lwloEL=J4YU=7 zUWQO@E1jOwY0pYJ$qx0vUMrJJJNOp&YsBioj{Ly zesY9Kpv~&4LGy8Ch1peg$1;lN>-z+C;Iv~_O!(l@p$>jj@ZM_q#MwO*cQstue;)jo>;s$)}7Fa-u|Axws;rkwp&3M zd&IZ0LE0k9e!Z2s{iN}i_m}5rVN{|F8aIDR zRAIJN*B5ECyV^E~YKBvr?a-YRAC}JGOwYfrcgwAlUPxsB(u6%>?TH*NKnr`K)+nnj z9}jd}J1FF)JUAno)*Sc8=TCJQU0YXHkcGKc(_nrrtuxnas{gKnYc<=9UAETjuRTzt z->o}d+%ud-%c3?ft6F@^_XpJI{3)rLLxjmzDv}M|lxuMl1zJ#@d2aO+X78Fe%=Wc& u4Wpj#Pqpj+QO*APp}cC&)%O)6l$wS{GuSX{t~IP%Jc>#*YB8~O?SBDF8MK7} diff --git a/languages/auto-load-next-post-fr_FR.po b/languages/auto-load-next-post-fr_FR.po index 1aa8eb4..bc0035b 100644 --- a/languages/auto-load-next-post-fr_FR.po +++ b/languages/auto-load-next-post-fr_FR.po @@ -1,140 +1,135 @@ # Auto Load Next Post Copyright (c) {2014} # Translators: # Franck, 2015 -# FxB , 2015 +# FX Bénard , 2015 +# FX Bénard , 2015 msgid "" msgstr "" "Project-Id-Version: Auto Load Next Post\n" "Report-Msgid-Bugs-To: https://github.com/seb86/WordPress-Plugin-Boilerplate/issues\n" -"POT-Creation-Date: 2015-05-17 18:45+0100\n" -"PO-Revision-Date: 2015-07-31 17:58+0200\n" -"Last-Translator: Franck\n" -"Language-Team: French (France) (http://www.transifex.com/projects/p/auto-load-next-post/language/fr_FR/)\n" +"POT-Creation-Date: 2015-10-19 16:22+0200\n" +"PO-Revision-Date: 2015-10-19 18:57+0200\n" +"Last-Translator: FX Bénard \n" +"Language-Team: French (France) (http://www.transifex.com/wp-translations/auto-load-next-post/language/fr_FR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: fr_FR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -"X-Generator: Poedit 1.8.3\n" +"X-Generator: Poedit 1.8.5\n" "X-Poedit-Basepath: ..\n" "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c;_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n" "X-Poedit-SourceCharset: UTF-8\n" "X-Textdomain-Support: yes\n" "X-Poedit-SearchPath-0: .\n" -#: auto-load-next-post.php:206 auto-load-next-post.php:218 -msgid "Cheatin’ huh?" -msgstr "Alors on essaye de tricher ?" +#: auto-load-next-post.php:84 auto-load-next-post.php:96 +msgid "Cheatin’ huh?" +msgstr "Alors on essaye de tricher ?" -#: auto-load-next-post.php:265 -msgid "Settings" -msgstr "Réglages" - -#: auto-load-next-post.php:266 includes/admin/class-auto-load-next-post-admin-help.php:56 -msgid "Support" -msgstr "Aide" - -#: auto-load-next-post.php:291 includes/admin/class-auto-load-next-post-admin-help.php:48 includes/admin/class-auto-load-next-post-admin.php:112 +#: includes/admin/class-auto-load-next-post-admin-help.php:47 includes/admin/class-auto-load-next-post-admin.php:78 includes/admin/class-auto-load-next-post-admin.php:149 msgid "Documentation" msgstr "Documentation" -#: auto-load-next-post.php:379 +#: includes/admin/class-auto-load-next-post-admin-help.php:49 #, php-format -msgid "Sorry, %s requires WordPress " -msgstr "Sorry, %s requires WordPress " +msgid "Thank you for using %1$s :) Should you need help using %1$s please read the documentation." +msgstr "Merci d'utiliser %1$s :) Si vous avez besoin d'aide pour utiliser ou modifier %1$s veuillez lire la documentation." #: includes/admin/class-auto-load-next-post-admin-help.php:50 #, php-format -msgid "Thank you for using %s :) Should you need help using or extending %s please read the documentation." -msgstr "Merci d'utiliser %s :) Si vous avez besoin d'aide pour utiliser ou modifier %s veuillez lire la documentation." - -#: includes/admin/class-auto-load-next-post-admin-help.php:51 -#, php-format msgid "%s Documentation" msgstr "Documentation de %s" -#: includes/admin/class-auto-load-next-post-admin-help.php:58 -#, php-format -msgid "After reading the documentation, for further assistance you can use the community forum." -msgstr "Après la lecture de la documentation, pour plus d'aide, vous pouvez utiliser le forum de la communauté." - -#: includes/admin/class-auto-load-next-post-admin-help.php:59 -msgid "Community Support" -msgstr "Forum de la communauté" - -#: includes/admin/class-auto-load-next-post-admin-help.php:64 +#: includes/admin/class-auto-load-next-post-admin-help.php:55 msgid "Found a bug?" -msgstr "Un bug à signaler ?" +msgstr "Un bug à signaler ?" -#: includes/admin/class-auto-load-next-post-admin-help.php:66 +#: includes/admin/class-auto-load-next-post-admin-help.php:57 #, php-format msgid "If you find a bug within %s you can create a ticket via Github issues. Ensure you read the contribution guide prior to submitting your report. Be as descriptive as possible. Thank you." msgstr "Si vous trouvez un a bug dans %s vous pouvez créer un ticket via les problèmes Github. Assurez-vous d'avoir lu le guide de contribution avant d'envoyer votre rapport. Soyez aussi descriptif que possible." -#: includes/admin/class-auto-load-next-post-admin-help.php:67 +#: includes/admin/class-auto-load-next-post-admin-help.php:58 msgid "Report a bug" msgstr "Signaler un bug" -#: includes/admin/class-auto-load-next-post-admin-help.php:71 +#: includes/admin/class-auto-load-next-post-admin-help.php:62 msgid "For more information:" msgstr "Pour plus d'informations :" -#: includes/admin/class-auto-load-next-post-admin-help.php:72 +#: includes/admin/class-auto-load-next-post-admin-help.php:63 #, php-format msgid "About %s" msgstr "À propos de %s" -#: includes/admin/class-auto-load-next-post-admin-help.php:73 +#: includes/admin/class-auto-load-next-post-admin-help.php:64 msgid "Project on WordPress.org" msgstr "Projet sur WordPress.org" -#: includes/admin/class-auto-load-next-post-admin-help.php:74 +#: includes/admin/class-auto-load-next-post-admin-help.php:65 msgid "Project on Github" msgstr "Projet sur GitHub" -#: includes/admin/class-auto-load-next-post-admin-menus.php:47 +#: includes/admin/class-auto-load-next-post-admin-menus.php:46 #, php-format msgid "%s Settings" msgstr "Réglages de %s" -#: includes/admin/class-auto-load-next-post-admin-settings.php:60 +#: includes/admin/class-auto-load-next-post-admin-settings.php:58 msgid "Action failed. Please refresh the page and retry." msgstr "Échec. Veuillez rafraîchir la page et réessayer." -#: includes/admin/class-auto-load-next-post-admin-settings.php:68 +#: includes/admin/class-auto-load-next-post-admin-settings.php:66 msgid "Your settings have been saved." msgstr "Vos réglages ont bien été enregistrés." -#: includes/admin/class-auto-load-next-post-admin-settings.php:138 includes/admin/class-auto-load-next-post-admin.php:83 +#: includes/admin/class-auto-load-next-post-admin-settings.php:135 includes/admin/class-auto-load-next-post-admin.php:123 msgid "The changes you made will be lost if you navigate away from this page." msgstr "Les modifications que vous avez faites seront perdues si vous quittez cette page." -#: includes/admin/class-auto-load-next-post-admin-settings.php:489 +#: includes/admin/class-auto-load-next-post-admin-settings.php:486 msgid "Hard Crop?" msgstr "Recadrage ?" -#: includes/admin/class-auto-load-next-post-admin-settings.php:511 +#: includes/admin/class-auto-load-next-post-admin-settings.php:508 msgid "Select a page…" msgstr "Sélectionner une page…" -#: includes/admin/class-auto-load-next-post-admin.php:111 +#: includes/admin/class-auto-load-next-post-admin.php:52 +msgid "Upgrade to Premium" +msgstr "Passer en Premium" + +#: includes/admin/class-auto-load-next-post-admin.php:53 +msgid "Settings" +msgstr "Réglages" + +#: includes/admin/class-auto-load-next-post-admin.php:54 includes/admin/settings/class-auto-load-next-post-settings-support.php:29 includes/admin/settings/class-auto-load-next-post-settings-support.php:75 +msgid "Support" +msgstr "Aide" + +#: includes/admin/class-auto-load-next-post-admin.php:79 +msgid "Community Support" +msgstr "Forum de la communauté" + +#: includes/admin/class-auto-load-next-post-admin.php:148 msgid "Website" msgstr "Site Web" -#: includes/admin/class-auto-load-next-post-admin.php:129 +#: includes/admin/class-auto-load-next-post-admin.php:165 #, php-format msgid "If you like %1$s please leave a ★★★★★ rating on WordPress.org. A huge thank you in advance!" msgstr "Si vous aimez %1$s veuillez laisser une évaluation ★★★★★ sur WordPress.org. Un grand merci d'avance !" -#: includes/admin/class-auto-load-next-post-admin.php:158 +#: includes/admin/class-auto-load-next-post-admin.php:192 msgid "Contribute" msgstr "Contribuer" -#: includes/admin/class-auto-load-next-post-admin.php:159 +#: includes/admin/class-auto-load-next-post-admin.php:193 msgid "Report Bugs" msgstr "Signaler un bug" -#: includes/admin/class-auto-load-next-post-admin.php:168 +#: includes/admin/class-auto-load-next-post-admin.php:202 #, php-format msgid "%s Version" msgstr "Version %s" @@ -143,90 +138,118 @@ msgstr "Version %s" msgid "General" msgstr "Réglages généraux" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:82 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:80 msgid "Information" msgstr "Information" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:84 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:82 msgid "For the plugin to work you need to set the variables below." msgstr "Pour que l'extension fonctionne, vous devez configurer les variables ci-dessous." -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:89 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:87 msgid "Restrict Post Types" msgstr "Restreindre les types d'articles" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:90 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:88 msgid "Select which post types you wish to load automatically." msgstr "Sélectionner les types d'articles que vous souhaitez charger automatiquement" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:102 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:100 msgid "Content Container" msgstr "Conteneur de contenu" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:103 -msgid "Example: div.single" -msgstr "Exemple : div.single" +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:101 +msgid "Example: main.site-main" +msgstr "Exemple : main.site-main" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:113 -msgid "Post ID Selector" -msgstr "Sélecteur d'identifiant d'article" - -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:114 -msgid "Example: article" -msgstr "Exemple : article" - -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:124 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:111 msgid "Post Title Selector" msgstr "Sélecteur du titre d'article" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:125 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:112 msgid "Example: h1.entry-title" msgstr "Exemple : h1.entry-title" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:135 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:122 msgid "Post Navigation Container" msgstr "Conteneur de navigation d'article" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:136 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:123 msgid "Example: nav.post-navigation" msgstr "Exemple : nav.post-navigation" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:146 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:133 msgid "Comments Container" msgstr "Conteneur de commentaires" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:147 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:134 msgid "Example: div#comments" msgstr "Exemple : div#comments" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:157 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:144 msgid "Remove Comments" msgstr "Supprimer les commentaires" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:158 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:145 msgid "Enable to remove comments when each post loads." msgstr "Activer la suppression des commentaires lorsque chaque article se charge." -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:165 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:152 msgid "Update Google Analytics" msgstr "Mettre à jour Google Analytics" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:166 -msgid "Enable to update your Google Analytics each time a post is automatically loaded." -msgstr "Activer la mise à jour votre Google Analytics chaque fois qu'un arcticle est automatiquement chargé." +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:153 +msgid "Each time a post is loaded it will count as a pageview. You must have a reference to your Google Analytics tracking code on the page." +msgstr "A chaque fois qu'un article est chargé cela sera compté comme une vue de page. Vous devez avoir installé une référence à votre code de suivi de Google Analytics sur cette page." + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:160 +msgid "Reset all data?" +msgstr "Réinitialiser toutes les données ?" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:173 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:161 +msgid "Press the reset button to clear all settings for this plugin and re-install the default settings." +msgstr "Appuyez sur le bouton de réinitialisation pour supprimer tous les réglages de l’extension et réinstaller tous les réglages par défaut." + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:168 msgid "Remove all data on uninstall?" msgstr "Supprimer toutes les données lors de la désinstallation ?" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:174 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:169 msgid "If enabled, all settings for this plugin will all be deleted when uninstalling via Plugins > Delete." msgstr "Si activée, tous les réglages pour cette extension seront tous supprimés lors de la désinstallation via Extensions > Supprimer." -#: includes/admin/views/html-admin-settings.php:24 -msgid "Save changes" +#: includes/admin/settings/class-auto-load-next-post-settings-support.php:56 +msgid "As this is a free plugin, I can not provide support." +msgstr "comme il s’agit d’une extension gratuite, je ne fournis aucun support." + +#: includes/admin/settings/class-auto-load-next-post-settings-support.php:57 +#, php-format +msgid "You may ask the WordPress community for help by posting to the WordPress.org support forum. Response time can range from a few days to a few weeks and will likely be from a non-developer." +msgstr "Vous pouvez demande de l’aide à la communauté de WordPress en publiant sur le forum d’entraide de WordPress.org. La réponse pourra prendre entre plusieurs jours à plusieurs semaines et pourra être d’une personne non-dev." + +#: includes/admin/settings/class-auto-load-next-post-settings-support.php:58 +#, php-format +msgid "If you want a timely response via email from me, upgrade and then send me an email." +msgstr "Si vous voulez une réponse rapide par e-mail de moi, mettez à niveau et envoyez-moi votre message." + +#: includes/admin/settings/class-auto-load-next-post-settings-support.php:59 +#, php-format +msgid "If you've found a bug, please submit an issue on GitHub." +msgstr "Si vous trouvez un bug, veuillez le signaler sur GitHub." + +#: includes/admin/settings/class-auto-load-next-post-settings-support.php:60 +msgid "Thank you." +msgstr "Merci." + +#: includes/admin/views/html-admin-settings.php:23 +msgid "Save Changes" msgstr "Enregistrer les modifications" +#: includes/admin/views/html-notice-requirement-wp.php:9 +#, php-format +msgid "Sorry, %s requires WordPress %s or higher. Please upgrade your WordPress setup." +msgstr "Désolé, %s requiert WordPress %s ou supérieur. Veuillez mettre à jour votre installation de WordPress." + #: includes/admin/views/html-notice-theme-support.php:10 msgid "Supporting your theme" msgstr "Prends en charge votre thème" @@ -235,16 +258,21 @@ msgstr "Prends en charge votre thème" msgid "Hide this notice" msgstr "Masquer cette notification" -#: template/content-partial.php:23 +#: includes/admin/wp-update-php/WPUpdatePhp.php:47 +#, php-format +msgid "Unfortunately, %s can not run on PHP versions older than " +msgstr "Malheureusement, %s ne fonctionne pas avec une version de PHP inférieure à " + +#: template/content-partial.php:53 msgid "Post navigation" msgstr "Navigation de l’article" -#: template/content-partial.php:25 +#: template/content-partial.php:55 msgctxt "Previous post link" msgid "←" msgstr "←" -#: template/content-partial.php:26 +#: template/content-partial.php:56 msgctxt "Next post link" msgid "→" msgstr "→" diff --git a/languages/auto-load-next-post-it_IT.mo b/languages/auto-load-next-post-it_IT.mo new file mode 100644 index 0000000000000000000000000000000000000000..c4cd10ab4f270c89ef22a341574026213d9006b4 GIT binary patch literal 4728 zcmaKvO>7)V6~`OM@?lt({eT5_VJprzarf9>lFg1kg5x-jMG~yoVRtWBH8V9cMS8ks zyQ{}G;iO-bj(t1gInVn%uYXq*Er7pzHy=Ddc~2C51iS}+5c~x=1^ym`jo8UR{$KXf7w?R4o-{6P9*~g;jec%!(`>cVY z&nDObHTVzk=iqO_AHKKJ^J^@U{oVvW0e&BR8hi_U0{mS){#Q`+eFywF_yk6M3Ooyn zz1Kj|<93ZZpzNE1{6%l@!P4j(;5G1D;IrT#LE+~^pTM^elJmX;`A{7F0Gt7T1d3gM21URB*7MIm zs@U-yDEcPgdGI>O(UAw)I(h>Xxo?6Jf8PV;oS%YF7ySlY2mb(m5_|z+nQwwJzYd-O zH$g%-g4*ziZ6eQb;2{k1L70R`xIV=zx{LorcU%%U6g`9^ObKTJk>WkgD;&vlf|n2t z+{*9cyr>u+u~VM26@*WTDbZ7GmN*t4iT=Xn!6SZ<=Q&>C>@&Q=m89awcwgWhKc@xHjAS06BQlxKZL9PqI;!E? zo*oQS(^QLX*D=c-J37&>k63Jkq3Ax5{#?S|`F`xJPt8MwGCfL$uJAEmY%h>;AbHK@ zYT$CCY}R%8Aj~x*84dQPWzS~HJGJZbyK3K+Dl?`d1BLNHWTbPeTd65j%cO2MVQmRP zTD8jFX25e56pQ5*$`) z>{@0;qGeRaq{gGkZr@}IzO%wJgKO2uYFsCJ7iw8u4RVPbBHDNDfo^KoqC}<^3!l5J zw|uHtY}8+aWLsydog3|OxI)jn*ehEvYSkwsmZnb?)647ZQMQyViqf!NFDGg(D@y2; z!&nVfgw2sPZNecqUt+CS!iFqV!`zCw5L>neHZUNYcDucB>5^-FTgA6P*=D%~0BtZj}*8;7wO z-7S@EK}Qc`>B?;%B^EpfprX7@}HRT|feyih=lM(X*XcIElAiQ}w+c7R^SZ7qTj$@-+(6x^%HICOWPX zJHFy5(fKe%{YI61Q=4Ddj#njLNvrrO6HPTgJ9i2&I*okd6V#IF=Vm!s#+XyNes;A(61WnlmqfwbY7mifip`O zj<<~-G}Q)`$x=a5s_nY+8YiI@Ft*X#vrcZYEp;6Su18XD^26zbxPsE;M; z8>D2|ykY&$#&+Y})Xj~XYlm#lC9_lYg%fY@4`IQxv;kE%Tacj1@!ry%?Q8L+Lpf2R zYw~z4c7It<>4li~z z=Vs;?cCre_qdS>%!+L7sdmG7i^Rw-luxL*N7%~T6vc2(KwpT5yWDk|uBHG)AmVdmj4QVD|sEnDhdk1Hh8+&*cjAU4yA{>2V+$1P35 zSAk)1id>*p)xCv{YBQXSNb|y-?(UOLnUg+-kPI_&g;}(?&$ei-FoU5bn;+4_92I#; z3v*P6O7^f8X4B+UU4Pia1lF37jCVC}naPOoVp9oKX=yr?0A(xsg)pP4M#iRAyX zIPYCT-(nU0!H5b#HLrS_NvEm0!LiY8SnH+M(IBz%a&$`<5QbY`r#0X@kY=ZA+nQ>w zbc`BjSb} zK~`voxEm6+o+C`mWAWI+BRvo*4y|sR86|9Y^+>WJ#cMQqC7CnQX<4P_WCQoWe&$h~ zQ9T!oJ3`-#jM(763>?a}j7_06%J7LDx^Zt5;wGxQp`&?Dw5X~P2sA?& zajJCA4lX74r9%!Sfqx-f>X=W{GxfA1j^$s5YUOzF^td~c!Yn=OM0+$II${h7GAJeT zB;xU&G)ZV7%1wlCIOj4t1#ct8e-YzfRRYp6r6VmVGvKl!rTQk=AWJLH(L7Q5#_iK& zzK$y$OC)o2t0hUq!a7Z>wH(~mgO=6u-O!pZ1n&O;kIZ1D literal 0 HcmV?d00001 diff --git a/languages/auto-load-next-post-it_IT.po b/languages/auto-load-next-post-it_IT.po new file mode 100644 index 0000000..31a996f --- /dev/null +++ b/languages/auto-load-next-post-it_IT.po @@ -0,0 +1,276 @@ +# Auto Load Next Post Copyright (c) {2014} +# Translators: +# Alessandro Curci , 2015 +msgid "" +msgstr "" +"Project-Id-Version: Auto Load Next Post\n" +"Report-Msgid-Bugs-To: https://github.com/seb86/WordPress-Plugin-Boilerplate/issues\n" +"POT-Creation-Date: 2015-10-19 16:22+0200\n" +"PO-Revision-Date: 2015-10-19 18:56+0200\n" +"Last-Translator: Sebastien D \n" +"Language-Team: Italian (Italy) (http://www.transifex.com/wp-translations/auto-load-next-post/language/it_IT/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: it_IT\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 1.8.5\n" +"X-Poedit-Basepath: ..\n" +"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c;_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Textdomain-Support: yes\n" +"X-Poedit-SearchPath-0: .\n" + +#: auto-load-next-post.php:84 auto-load-next-post.php:96 +msgid "Cheatin’ huh?" +msgstr "" + +#: includes/admin/class-auto-load-next-post-admin-help.php:47 includes/admin/class-auto-load-next-post-admin.php:78 includes/admin/class-auto-load-next-post-admin.php:149 +msgid "Documentation" +msgstr "Documentazione" + +#: includes/admin/class-auto-load-next-post-admin-help.php:49 +#, php-format +msgid "Thank you for using %1$s :) Should you need help using %1$s please read the documentation." +msgstr "" + +#: includes/admin/class-auto-load-next-post-admin-help.php:50 +#, php-format +msgid "%s Documentation" +msgstr "Documentazione di %s" + +#: includes/admin/class-auto-load-next-post-admin-help.php:55 +msgid "Found a bug?" +msgstr "Hai trovato un bug?" + +#: includes/admin/class-auto-load-next-post-admin-help.php:57 +#, php-format +msgid "If you find a bug within %s you can create a ticket via Github issues. Ensure you read the contribution guide prior to submitting your report. Be as descriptive as possible. Thank you." +msgstr "Se trovi un bug in %s puoi creare un ticket su Github issues. Assicurati di leggere la guida di contribuzione prima di inviare la tua segnalazione. Sii il più descrittivo possibile. Grazie." + +#: includes/admin/class-auto-load-next-post-admin-help.php:58 +msgid "Report a bug" +msgstr "Segnala un bug" + +#: includes/admin/class-auto-load-next-post-admin-help.php:62 +msgid "For more information:" +msgstr "Per altre informazioni:" + +#: includes/admin/class-auto-load-next-post-admin-help.php:63 +#, php-format +msgid "About %s" +msgstr "Informazioni su %s" + +#: includes/admin/class-auto-load-next-post-admin-help.php:64 +msgid "Project on WordPress.org" +msgstr "Progetto su WordPress.org" + +#: includes/admin/class-auto-load-next-post-admin-help.php:65 +msgid "Project on Github" +msgstr "Progetto su Github" + +#: includes/admin/class-auto-load-next-post-admin-menus.php:46 +#, php-format +msgid "%s Settings" +msgstr "%s Impostazioni" + +#: includes/admin/class-auto-load-next-post-admin-settings.php:58 +msgid "Action failed. Please refresh the page and retry." +msgstr "Azione non riuscita. Si prega di aggiornare la pagina e riprovare." + +#: includes/admin/class-auto-load-next-post-admin-settings.php:66 +msgid "Your settings have been saved." +msgstr "Le tue impostazioni sono state salvate." + +#: includes/admin/class-auto-load-next-post-admin-settings.php:135 includes/admin/class-auto-load-next-post-admin.php:123 +msgid "The changes you made will be lost if you navigate away from this page." +msgstr "Se si abbandona questa pagina i cambiamenti effettuati verranno persi ." + +#: includes/admin/class-auto-load-next-post-admin-settings.php:486 +msgid "Hard Crop?" +msgstr "Ritaglio netto?" + +#: includes/admin/class-auto-load-next-post-admin-settings.php:508 +msgid "Select a page…" +msgstr "Seleziona una pagina…" + +#: includes/admin/class-auto-load-next-post-admin.php:52 +msgid "Upgrade to Premium" +msgstr "Aggiorna ora" + +#: includes/admin/class-auto-load-next-post-admin.php:53 +msgid "Settings" +msgstr "Impostazioni" + +#: includes/admin/class-auto-load-next-post-admin.php:54 includes/admin/settings/class-auto-load-next-post-settings-support.php:29 includes/admin/settings/class-auto-load-next-post-settings-support.php:75 +msgid "Support" +msgstr "Supporto" + +#: includes/admin/class-auto-load-next-post-admin.php:79 +msgid "Community Support" +msgstr "Supporto comunitario" + +#: includes/admin/class-auto-load-next-post-admin.php:148 +msgid "Website" +msgstr "Sito web" + +#: includes/admin/class-auto-load-next-post-admin.php:165 +#, php-format +msgid "If you like %1$s please leave a ★★★★★ rating on WordPress.org. A huge thank you in advance!" +msgstr "Se %1$s ti piace, per favore lascia una valutazione ★★★★★ su WordPress.org. Un immenso grazie in anticipo!" + +#: includes/admin/class-auto-load-next-post-admin.php:192 +msgid "Contribute" +msgstr "Contribuisci" + +#: includes/admin/class-auto-load-next-post-admin.php:193 +msgid "Report Bugs" +msgstr "Segnala i bug" + +#: includes/admin/class-auto-load-next-post-admin.php:202 +#, php-format +msgid "%s Version" +msgstr "Versione %s" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:31 +msgid "General" +msgstr "Impostazioni Generali" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:80 +msgid "Information" +msgstr "Informazioni" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:82 +msgid "For the plugin to work you need to set the variables below." +msgstr "Per far funzionare il plugin devi impostare le variabili qui sotto." + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:87 +msgid "Restrict Post Types" +msgstr "" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:88 +msgid "Select which post types you wish to load automatically." +msgstr "" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:100 +msgid "Content Container" +msgstr "Contenitore del contenuto" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:101 +msgid "Example: main.site-main" +msgstr "" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:111 +msgid "Post Title Selector" +msgstr "Selettore titolo dell'articolo" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:112 +msgid "Example: h1.entry-title" +msgstr "Esempio: h1.entry-title" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:122 +msgid "Post Navigation Container" +msgstr "Contenitore della navigazione degli articoli" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:123 +msgid "Example: nav.post-navigation" +msgstr "Esempio: nav.post-navigation" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:133 +msgid "Comments Container" +msgstr "Contenitore dei commenti" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:134 +msgid "Example: div#comments" +msgstr "Esempio: div#comments" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:144 +msgid "Remove Comments" +msgstr "" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:145 +msgid "Enable to remove comments when each post loads." +msgstr "" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:152 +msgid "Update Google Analytics" +msgstr "Aggiorna Google Analytics " + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:153 +msgid "Each time a post is loaded it will count as a pageview. You must have a reference to your Google Analytics tracking code on the page." +msgstr "" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:160 +msgid "Reset all data?" +msgstr "" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:161 +msgid "Press the reset button to clear all settings for this plugin and re-install the default settings." +msgstr "" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:168 +msgid "Remove all data on uninstall?" +msgstr "Rimuovi tutti i dati alla disinstallazione?" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:169 +msgid "If enabled, all settings for this plugin will all be deleted when uninstalling via Plugins > Delete." +msgstr "Se abilitato, tutte le impostazioni per questo plugin saranno cancellate quando si disinstalla attraverso Plugin > Cancella." + +#: includes/admin/settings/class-auto-load-next-post-settings-support.php:56 +msgid "As this is a free plugin, I can not provide support." +msgstr "" + +#: includes/admin/settings/class-auto-load-next-post-settings-support.php:57 +#, php-format +msgid "You may ask the WordPress community for help by posting to the WordPress.org support forum. Response time can range from a few days to a few weeks and will likely be from a non-developer." +msgstr "" + +#: includes/admin/settings/class-auto-load-next-post-settings-support.php:58 +#, php-format +msgid "If you want a timely response via email from me, upgrade and then send me an email." +msgstr "" + +#: includes/admin/settings/class-auto-load-next-post-settings-support.php:59 +#, php-format +msgid "If you've found a bug, please submit an issue on GitHub." +msgstr "" + +#: includes/admin/settings/class-auto-load-next-post-settings-support.php:60 +msgid "Thank you." +msgstr "" + +#: includes/admin/views/html-admin-settings.php:23 +msgid "Save Changes" +msgstr "Salva le modifiche" + +#: includes/admin/views/html-notice-requirement-wp.php:9 +#, php-format +msgid "Sorry, %s requires WordPress %s or higher. Please upgrade your WordPress setup." +msgstr "" + +#: includes/admin/views/html-notice-theme-support.php:10 +msgid "Supporting your theme" +msgstr "" + +#: includes/admin/views/html-notice-theme-support.php:10 +msgid "Hide this notice" +msgstr "Nascondi questa notifica" + +#: includes/admin/wp-update-php/WPUpdatePhp.php:47 +#, php-format +msgid "Unfortunately, %s can not run on PHP versions older than " +msgstr "" + +#: template/content-partial.php:53 +msgid "Post navigation" +msgstr "Navigazione articolo" + +#: template/content-partial.php:55 +msgctxt "Previous post link" +msgid "←" +msgstr "←" + +#: template/content-partial.php:56 +msgctxt "Next post link" +msgid "→" +msgstr "→" diff --git a/languages/auto-load-next-post-ro_RO.mo b/languages/auto-load-next-post-ro_RO.mo index 502893d27972b7c735176eead2ad63e11077877d..6feaf763554f189017a5ec950491c2e571f4d8eb 100644 GIT binary patch delta 1286 zcmZwGOKeP09LMo9ebMRrp$}CvN@>g0nTcts2Gz!bMx|}UN;9~rMrSIWsYZw)u^=K6 zS7SjUB7y~**;oleVu45yNh1vlM9M;ArwQNR%D#qUNWt2p^&LdWj9j zB+Wb@Rx#kqHKrMRa0$k6GoHmle2k0m6>7ovsKh?uA^e52xHr$3H@Kb2O1Oe7wVn@a zF^m=1hb8Q94!U2&QJG)F8oZI7V9Z0Tr~d-A;8#>abEt*>y8Vj$%tn4}XS@yh%EVBK zPrBbHaR>b=tY&}n(Vg%cm(!oeZpvTBF?GTr>ZTJPMQwZnnPSdi7hc9ne1}!|9hI0V z&it+t88SZHg%(nJa~zW@{dGPx;}g_LXK^>?mt+>+hdMzNweSQg(epTtcd>?hQ%APb z^fypORjPyw!P_u(sM0r}66{1(dZ3*8Yl7_#jG{_^%AI%>o9I74_Ann%34Fs9_y?=8 zo8&E>adElrn7 zq0+CT>0K-Nh0wv2)Owm;pAxO3wbFbvRU}vMU!l|KowTU)pHLMPD>I~@I-yRnl%{ej zR9^m2#!u7TX{70{D6%r7pR0MQg7s^7=nm-bPBqh^N^k{?<=oF1c5daKah$wh>Puc> zwv*+Z@pL<%y+h9a0$*ybpxToR2CU#Ff3U416j~by1p?kZeOAAHY$QH17PERH3A@7| z3IxNJJ8xr0xIHtkHxf@+gX57{d^D068}INB*asLIv19%oe`ho@G8(nF#TUj7O+?3H ziS-A^qFcPZk=XD=WZ1R_?TB-sC{Qwa)JnJuv1{CUUNr9sr=Auc@i>o5Z#zHALaD9g ar?XRUmn`yRjoQw1)v$B8y4h*0x%Urlu$K7% delta 2316 zcmZ{kOKcTY7{^bg2yH2^@_y)n+RC%-r9h!vDV3@r1|$NqGUhn<^xlEFGuL@sX<1xj zUAQ1Y9StbDP+S-npdk`tTo}PvSr8XUA|xglOiaMU#Ek|u{=VU&BJrf({LY*?=R4oy zfBVz2^SRo0GaFx1j6Q4;cA-J3ZSc?p9*hqfm6{Gege~xM*bL9Z$?#j4gWtnZIBTL( zZSXLh36H}W@N}KyP|jb1txDC@4@|mQ_yz8S?RP7+7{+iZda1^6Dk23v{#YwlOSF_Fy9HQjW05z2w zHVv+Xvc3sQW_#c~Sge144oU(qLGgP6N?@Nr@$+T<{W6@*{pv?1QvN@olyp6(#K8b0 zSoI{7Of8JzLHIEI8P0`$c$a;T!F%9dI7s`dP!jo=sBx{nf-I>Eket*NSQ}(=jme8} zHM`}*X*dgh2Is(UphSKhiX%yz-l-P&D4Y*V&_W6PJe1a5hZ;^p2-3P9xE$_*vadFi z`tM-!77KFWbtsuMaGPA%#6vP#3`3ZQ^APAsc!~FM4p9Vkobn(CbrSMPorcn)b5Ihv z3W-JCfU>WZMR}h!hx$wJI$4m713Z?&Cm=;pH7E`b!zJ)I#E1F<%CF@z+yZ}v68J{? z(Fq5k1XhBwFNP_68SaK1Tq+e9tuc{}N1>GFT}XmzJtjlG$&hlc#^jPdO!~MAqhRVT zOojw1?UNxv(5)=FE?HnmATp+6lKo1owvdNp+K%xH%*HyNS)ZYlUot1~tU^HDi%CE4 z#};5Rva;TsW>2Y-uD?qwMA$NVG0D6UTO)b)Fsc8qQEQpY5G_a>WOQR4*a~@JNR@Kw z?8ahka5%Q1&Kq3{?eGIjJEEnVLu(4IU(|8Q>O$ZoW$VW#b^|}(Z8opc!$GKrlaQ~W zHc{k8vGEEbb@j@@!fbtPA6q?)TOqTteF%0>b>}C_P!L#}9?Crl_3vSvvaY=K*t#(CJ!Lz64PHdmh zvTaE3vYvI~AWYXzzS`iV^P8Sp6olc(D%}z3&_0v6p^fz3AS~=;66v(sw4`SI{aIzC zXo>jK`6vzpzqq+0%6HeNx_`OeRSFWXknQ!YE$EWo*^^5@ZC=pQ)3>@er*nP%>o%lUn&)Jv0F9b_14weIB`N= zqvlRA6|5e1tz$wYZ@5D{XWsD(I`MU;mcY}Nxb>M6zH@dgbWD6pYN9TSx{}+}6?l{C z@=6a(?ftiyUY&YmLNj6-6cGmAsURT8*{7pk)cZ>IM-(r da;tJUOp0g62#u-Z&Wc^R?Y1U&rDxjS{|oj+@UQ>? diff --git a/languages/auto-load-next-post-ro_RO.po b/languages/auto-load-next-post-ro_RO.po index baf21b7..220a534 100644 --- a/languages/auto-load-next-post-ro_RO.po +++ b/languages/auto-load-next-post-ro_RO.po @@ -5,135 +5,129 @@ msgid "" msgstr "" "Project-Id-Version: Auto Load Next Post\n" "Report-Msgid-Bugs-To: https://github.com/seb86/WordPress-Plugin-Boilerplate/issues\n" -"POT-Creation-Date: 2015-05-17 18:45+0100\n" -"PO-Revision-Date: 2015-07-31 17:58+0200\n" -"Last-Translator: Moldovan Dragos Calin \n" -"Language-Team: Romanian (Romania) (http://www.transifex.com/projects/p/auto-load-next-post/language/ro_RO/)\n" +"POT-Creation-Date: 2015-10-19 16:22+0200\n" +"PO-Revision-Date: 2015-10-19 18:57+0200\n" +"Last-Translator: Sebastien D \n" +"Language-Team: Romanian (Romania) (http://www.transifex.com/wp-translations/auto-load-next-post/language/ro_RO/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: ro_RO\n" "Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n" -"X-Generator: Poedit 1.8.3\n" +"X-Generator: Poedit 1.8.5\n" "X-Poedit-Basepath: ..\n" "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c;_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n" "X-Poedit-SourceCharset: UTF-8\n" "X-Textdomain-Support: yes\n" "X-Poedit-SearchPath-0: .\n" -#: auto-load-next-post.php:206 auto-load-next-post.php:218 -msgid "Cheatin’ huh?" -msgstr "TriÈ™ezi?" - -#: auto-load-next-post.php:265 -msgid "Settings" -msgstr "Setări" - -#: auto-load-next-post.php:266 includes/admin/class-auto-load-next-post-admin-help.php:56 -msgid "Support" -msgstr "Asistenţă" +#: auto-load-next-post.php:84 auto-load-next-post.php:96 +msgid "Cheatin’ huh?" +msgstr "" -#: auto-load-next-post.php:291 includes/admin/class-auto-load-next-post-admin-help.php:48 includes/admin/class-auto-load-next-post-admin.php:112 +#: includes/admin/class-auto-load-next-post-admin-help.php:47 includes/admin/class-auto-load-next-post-admin.php:78 includes/admin/class-auto-load-next-post-admin.php:149 msgid "Documentation" msgstr "DocumentaÈ›ie" -#: auto-load-next-post.php:379 +#: includes/admin/class-auto-load-next-post-admin-help.php:49 #, php-format -msgid "Sorry, %s requires WordPress " -msgstr "Ne cerem scuze, %s necesită WordPress" +msgid "Thank you for using %1$s :) Should you need help using %1$s please read the documentation." +msgstr "" #: includes/admin/class-auto-load-next-post-admin-help.php:50 #, php-format -msgid "Thank you for using %s :) Should you need help using or extending %s please read the documentation." -msgstr "MulÈ›umim că folosiÈ›i %s :) Dacă aveÈ›i nevoie de ajutor pentru a folosi sau a extinde %s vă rugăm să citiÈ›i documentaÈ›ia." - -#: includes/admin/class-auto-load-next-post-admin-help.php:51 -#, php-format msgid "%s Documentation" msgstr "%s DocumentaÈ›ie" -#: includes/admin/class-auto-load-next-post-admin-help.php:58 -#, php-format -msgid "After reading the documentation, for further assistance you can use the community forum." -msgstr "După ce aÈ›i citit documentaÈ›ia, pentru asistență pe viitor puteÈ›i folosi forumul comunității." - -#: includes/admin/class-auto-load-next-post-admin-help.php:59 -msgid "Community Support" -msgstr "Asistență Comunitate" - -#: includes/admin/class-auto-load-next-post-admin-help.php:64 +#: includes/admin/class-auto-load-next-post-admin-help.php:55 msgid "Found a bug?" msgstr "AÈ›i găsit un bug ?" -#: includes/admin/class-auto-load-next-post-admin-help.php:66 +#: includes/admin/class-auto-load-next-post-admin-help.php:57 #, php-format msgid "If you find a bug within %s you can create a ticket via Github issues. Ensure you read the contribution guide prior to submitting your report. Be as descriptive as possible. Thank you." msgstr "Dacă descoperiÈ›i o eroare în %s puteÈ›i creea un ticket pe Github issues. AsiguraÈ›i-vă că aÈ›i citit ghidul contribuitorului înainte să trimiteÈ›i raportul dumneavoastră. FiÈ›i cât de descriptiv se poate. Vă mulÈ›umim." -#: includes/admin/class-auto-load-next-post-admin-help.php:67 +#: includes/admin/class-auto-load-next-post-admin-help.php:58 msgid "Report a bug" msgstr "RaportaÈ›i o eroare" -#: includes/admin/class-auto-load-next-post-admin-help.php:71 +#: includes/admin/class-auto-load-next-post-admin-help.php:62 msgid "For more information:" msgstr "Pentru mai multe informaÈ›ii:" -#: includes/admin/class-auto-load-next-post-admin-help.php:72 +#: includes/admin/class-auto-load-next-post-admin-help.php:63 #, php-format msgid "About %s" msgstr "Despre %s" -#: includes/admin/class-auto-load-next-post-admin-help.php:73 +#: includes/admin/class-auto-load-next-post-admin-help.php:64 msgid "Project on WordPress.org" msgstr "Proiect pe WordPress.org" -#: includes/admin/class-auto-load-next-post-admin-help.php:74 +#: includes/admin/class-auto-load-next-post-admin-help.php:65 msgid "Project on Github" msgstr "Proiect pe Github" -#: includes/admin/class-auto-load-next-post-admin-menus.php:47 +#: includes/admin/class-auto-load-next-post-admin-menus.php:46 #, php-format msgid "%s Settings" msgstr "%s Setări" -#: includes/admin/class-auto-load-next-post-admin-settings.php:60 +#: includes/admin/class-auto-load-next-post-admin-settings.php:58 msgid "Action failed. Please refresh the page and retry." msgstr "AcÈ›iune eÈ™uată. ReîncăcaÈ›i pagina È™i încercaÈ›i din nou. " -#: includes/admin/class-auto-load-next-post-admin-settings.php:68 +#: includes/admin/class-auto-load-next-post-admin-settings.php:66 msgid "Your settings have been saved." msgstr "Setările dumneavoastră au fost salvate." -#: includes/admin/class-auto-load-next-post-admin-settings.php:138 includes/admin/class-auto-load-next-post-admin.php:83 +#: includes/admin/class-auto-load-next-post-admin-settings.php:135 includes/admin/class-auto-load-next-post-admin.php:123 msgid "The changes you made will be lost if you navigate away from this page." msgstr "Schimbările pe care le-ai făcut se vor pierde dacă părăseÈ™ti această pagină." -#: includes/admin/class-auto-load-next-post-admin-settings.php:489 +#: includes/admin/class-auto-load-next-post-admin-settings.php:486 msgid "Hard Crop?" msgstr "Decupare forÈ›ată?" -#: includes/admin/class-auto-load-next-post-admin-settings.php:511 +#: includes/admin/class-auto-load-next-post-admin-settings.php:508 msgid "Select a page…" msgstr "SelectaÈ›i o pagină…" -#: includes/admin/class-auto-load-next-post-admin.php:111 +#: includes/admin/class-auto-load-next-post-admin.php:52 +msgid "Upgrade to Premium" +msgstr "" + +#: includes/admin/class-auto-load-next-post-admin.php:53 +msgid "Settings" +msgstr "Setări" + +#: includes/admin/class-auto-load-next-post-admin.php:54 includes/admin/settings/class-auto-load-next-post-settings-support.php:29 includes/admin/settings/class-auto-load-next-post-settings-support.php:75 +msgid "Support" +msgstr "Asistenţă" + +#: includes/admin/class-auto-load-next-post-admin.php:79 +msgid "Community Support" +msgstr "Asistență Comunitate" + +#: includes/admin/class-auto-load-next-post-admin.php:148 msgid "Website" msgstr "Pagină web" -#: includes/admin/class-auto-load-next-post-admin.php:129 +#: includes/admin/class-auto-load-next-post-admin.php:165 #, php-format msgid "If you like %1$s please leave a ★★★★★ rating on WordPress.org. A huge thank you in advance!" msgstr "Dacă iÈ™i place %1$s te rugăm să laÈ™i ★★★★★ un vot pe WordPress.org. Un mare mulÈ›umim în avans." -#: includes/admin/class-auto-load-next-post-admin.php:158 +#: includes/admin/class-auto-load-next-post-admin.php:192 msgid "Contribute" msgstr "Contribuie" -#: includes/admin/class-auto-load-next-post-admin.php:159 +#: includes/admin/class-auto-load-next-post-admin.php:193 msgid "Report Bugs" msgstr "Raportare erori" -#: includes/admin/class-auto-load-next-post-admin.php:168 +#: includes/admin/class-auto-load-next-post-admin.php:202 #, php-format msgid "%s Version" msgstr "Versiunea %s" @@ -142,89 +136,117 @@ msgstr "Versiunea %s" msgid "General" msgstr "General" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:82 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:80 msgid "Information" msgstr "InformaÈ›ii" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:84 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:82 msgid "For the plugin to work you need to set the variables below." msgstr "Pentru ca pluginul să funcÈ›ioneze trebuie să setaÈ›i variabilele de mai jos" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:89 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:87 msgid "Restrict Post Types" msgstr "RestricÈ›ionati Tipuri de Articol" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:90 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:88 msgid "Select which post types you wish to load automatically." msgstr "Selectati ce tipuri de articole doriÈ›i să se încarce automat." -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:102 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:100 msgid "Content Container" msgstr "Recipient conÈ›inut" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:103 -msgid "Example: div.single" -msgstr "Exemplu: div.single" - -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:113 -msgid "Post ID Selector" -msgstr "Selector ID Articol" - -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:114 -msgid "Example: article" -msgstr "Exemplu: articol" +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:101 +msgid "Example: main.site-main" +msgstr "" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:124 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:111 msgid "Post Title Selector" msgstr "Selector Titlu Articol" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:125 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:112 msgid "Example: h1.entry-title" msgstr "Exemplu: h1.entry-title" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:135 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:122 msgid "Post Navigation Container" msgstr "Selector Navigare Articol" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:136 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:123 msgid "Example: nav.post-navigation" msgstr "Exemplu: nav.post-navigation" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:146 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:133 msgid "Comments Container" msgstr "Recipient Comentarii" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:147 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:134 msgid "Example: div#comments" msgstr "Exemplu: div#comments" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:157 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:144 msgid "Remove Comments" msgstr "StergeÈ›i Comentariile" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:158 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:145 msgid "Enable to remove comments when each post loads." msgstr "ActivaÈ›i pentru a È™terge comentariile când fiecare articol se încarcă." -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:165 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:152 msgid "Update Google Analytics" msgstr "ActualizaÈ›i Google Analytics" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:166 -msgid "Enable to update your Google Analytics each time a post is automatically loaded." -msgstr "ActivaÈ›i pentru a actualiza Google Analytics de fiecare dată când un articol este încărcat automat." +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:153 +msgid "Each time a post is loaded it will count as a pageview. You must have a reference to your Google Analytics tracking code on the page." +msgstr "" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:160 +msgid "Reset all data?" +msgstr "" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:173 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:161 +msgid "Press the reset button to clear all settings for this plugin and re-install the default settings." +msgstr "" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:168 msgid "Remove all data on uninstall?" msgstr "ȘtergeÈ›i toate datele la dezinstalare?" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:174 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:169 msgid "If enabled, all settings for this plugin will all be deleted when uninstalling via Plugins > Delete." msgstr "Dacă este activat , toate setările pentru acest plugin vor fi È™terse la dezinstalare prin Pluginuri > Șterge ." -#: includes/admin/views/html-admin-settings.php:24 -msgid "Save changes" -msgstr "Salvează modificări" +#: includes/admin/settings/class-auto-load-next-post-settings-support.php:56 +msgid "As this is a free plugin, I can not provide support." +msgstr "" + +#: includes/admin/settings/class-auto-load-next-post-settings-support.php:57 +#, php-format +msgid "You may ask the WordPress community for help by posting to the WordPress.org support forum. Response time can range from a few days to a few weeks and will likely be from a non-developer." +msgstr "" + +#: includes/admin/settings/class-auto-load-next-post-settings-support.php:58 +#, php-format +msgid "If you want a timely response via email from me, upgrade and then send me an email." +msgstr "" + +#: includes/admin/settings/class-auto-load-next-post-settings-support.php:59 +#, php-format +msgid "If you've found a bug, please submit an issue on GitHub." +msgstr "" + +#: includes/admin/settings/class-auto-load-next-post-settings-support.php:60 +msgid "Thank you." +msgstr "" + +#: includes/admin/views/html-admin-settings.php:23 +msgid "Save Changes" +msgstr "Salvează modificările" + +#: includes/admin/views/html-notice-requirement-wp.php:9 +#, php-format +msgid "Sorry, %s requires WordPress %s or higher. Please upgrade your WordPress setup." +msgstr "" #: includes/admin/views/html-notice-theme-support.php:10 msgid "Supporting your theme" @@ -234,16 +256,21 @@ msgstr "Suportă tema dumneavoastră" msgid "Hide this notice" msgstr "AscundeÈ›i această notificare" -#: template/content-partial.php:23 +#: includes/admin/wp-update-php/WPUpdatePhp.php:47 +#, php-format +msgid "Unfortunately, %s can not run on PHP versions older than " +msgstr "" + +#: template/content-partial.php:53 msgid "Post navigation" msgstr "Navigare articole" -#: template/content-partial.php:25 +#: template/content-partial.php:55 msgctxt "Previous post link" msgid "←" msgstr "←" -#: template/content-partial.php:26 +#: template/content-partial.php:56 msgctxt "Next post link" msgid "→" msgstr "→" diff --git a/languages/auto-load-next-post.pot b/languages/auto-load-next-post.pot index 6b52ae1..8ae57f0 100644 --- a/languages/auto-load-next-post.pot +++ b/languages/auto-load-next-post.pot @@ -1,10 +1,11 @@ # Auto Load Next Post Copyright (c) {2014} +#, fuzzy msgid "" msgstr "" -"Project-Id-Version: Auto Load Next Post 1.0.0\n" +"Project-Id-Version: Auto Load Next Post 1.4.3\n" "Report-Msgid-Bugs-To: https://github.com/seb86/WordPress-Plugin-Boilerplate/" "issues\n" -"POT-Creation-Date: 2015-05-20 17:15+0100\n" +"POT-Creation-Date: 2015-10-19 16:22+0200\n" "PO-Revision-Date: 2015-05-20 17:15+0100\n" "Last-Translator: Auto Load Next Post \n" "Language-Team: WP-Translations \n" @@ -12,7 +13,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.7.6\n" +"X-Generator: Poedit 1.8.5\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Poedit-Basepath: ..\n" "X-Poedit-SourceCharset: UTF-8\n" @@ -21,58 +22,33 @@ msgstr "" "X-Textdomain-Support: yes\n" "X-Poedit-SearchPath-0: .\n" -#: auto-load-next-post.php:206 auto-load-next-post.php:218 -msgid "Cheatin’ huh?" +#: auto-load-next-post.php:84 auto-load-next-post.php:96 +msgid "Cheatin’ huh?" msgstr "" -#: auto-load-next-post.php:265 -msgid "Settings" -msgstr "" - -#: auto-load-next-post.php:266 -#: includes/admin/class-auto-load-next-post-admin-help.php:56 -msgid "Support" -msgstr "" - -#: auto-load-next-post.php:291 -#: includes/admin/class-auto-load-next-post-admin-help.php:48 -#: includes/admin/class-auto-load-next-post-admin.php:112 +#: includes/admin/class-auto-load-next-post-admin-help.php:47 +#: includes/admin/class-auto-load-next-post-admin.php:78 +#: includes/admin/class-auto-load-next-post-admin.php:149 msgid "Documentation" msgstr "" -#: auto-load-next-post.php:379 -#, php-format -msgid "Sorry, %s requires WordPress " -msgstr "" - -#: includes/admin/class-auto-load-next-post-admin-help.php:50 +#: includes/admin/class-auto-load-next-post-admin-help.php:49 #, php-format msgid "" -"Thank you for using %s :) Should you need help using or " -"extending %s please read the documentation." +"Thank you for using %1$s :) Should you need help using " +"%1$s please read the documentation." msgstr "" -#: includes/admin/class-auto-load-next-post-admin-help.php:51 +#: includes/admin/class-auto-load-next-post-admin-help.php:50 #, php-format msgid "%s Documentation" msgstr "" -#: includes/admin/class-auto-load-next-post-admin-help.php:58 -#, php-format -msgid "" -"After reading the documentation, for further assistance " -"you can use the community forum." -msgstr "" - -#: includes/admin/class-auto-load-next-post-admin-help.php:59 -msgid "Community Support" -msgstr "" - -#: includes/admin/class-auto-load-next-post-admin-help.php:64 +#: includes/admin/class-auto-load-next-post-admin-help.php:55 msgid "Found a bug?" msgstr "" -#: includes/admin/class-auto-load-next-post-admin-help.php:66 +#: includes/admin/class-auto-load-next-post-admin-help.php:57 #, php-format msgid "" "If you find a bug within %s you can create a ticket via %1$s please leave a WordPress.org. A huge thank you in advance!" msgstr "" -#: includes/admin/class-auto-load-next-post-admin.php:158 +#: includes/admin/class-auto-load-next-post-admin.php:192 msgid "Contribute" msgstr "" -#: includes/admin/class-auto-load-next-post-admin.php:159 +#: includes/admin/class-auto-load-next-post-admin.php:193 msgid "Report Bugs" msgstr "" -#: includes/admin/class-auto-load-next-post-admin.php:168 +#: includes/admin/class-auto-load-next-post-admin.php:202 #, php-format msgid "%s Version" msgstr "" @@ -157,84 +151,130 @@ msgstr "" msgid "General" msgstr "" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:82 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:80 msgid "Information" msgstr "" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:84 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:82 msgid "For the plugin to work you need to set the variables below." msgstr "" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:89 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:87 msgid "Restrict Post Types" msgstr "" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:90 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:88 msgid "Select which post types you wish to load automatically." msgstr "" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:102 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:100 msgid "Content Container" msgstr "" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:103 -msgid "Example: div.single" +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:101 +msgid "Example: main.site-main" msgstr "" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:124 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:111 msgid "Post Title Selector" msgstr "" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:125 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:112 msgid "Example: h1.entry-title" msgstr "" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:135 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:122 msgid "Post Navigation Container" msgstr "" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:136 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:123 msgid "Example: nav.post-navigation" msgstr "" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:146 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:133 msgid "Comments Container" msgstr "" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:147 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:134 msgid "Example: div#comments" msgstr "" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:157 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:144 msgid "Remove Comments" msgstr "" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:158 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:145 msgid "Enable to remove comments when each post loads." msgstr "" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:165 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:152 msgid "Update Google Analytics" msgstr "" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:166 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:153 +msgid "" +"Each time a post is loaded it will count as a pageview. You must have a " +"reference to your Google Analytics tracking code on the page." +msgstr "" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:160 +msgid "Reset all data?" +msgstr "" + +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:161 msgid "" -"Enable to update your Google Analytics each time a post is automatically " -"loaded." +"Press the reset button to clear all settings for this plugin and re-install " +"the default settings." msgstr "" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:173 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:168 msgid "Remove all data on uninstall?" msgstr "" -#: includes/admin/settings/class-auto-load-next-post-settings-general.php:174 +#: includes/admin/settings/class-auto-load-next-post-settings-general.php:169 msgid "" "If enabled, all settings for this plugin will all be deleted when " "uninstalling via Plugins > Delete." msgstr "" -#: includes/admin/views/html-admin-settings.php:24 -msgid "Save changes" +#: includes/admin/settings/class-auto-load-next-post-settings-support.php:56 +msgid "As this is a free plugin, I can not provide support." +msgstr "" + +#: includes/admin/settings/class-auto-load-next-post-settings-support.php:57 +#, php-format +msgid "" +"You may ask the WordPress community for help by posting to the WordPress.org support forum. Response time can range from a few days " +"to a few weeks and will likely be from a non-developer." +msgstr "" + +#: includes/admin/settings/class-auto-load-next-post-settings-support.php:58 +#, php-format +msgid "" +"If you want a timely response via email from me, upgrade and then send me an email." +msgstr "" + +#: includes/admin/settings/class-auto-load-next-post-settings-support.php:59 +#, php-format +msgid "" +"If you've found a bug, please submit an issue on GitHub." +msgstr "" + +#: includes/admin/settings/class-auto-load-next-post-settings-support.php:60 +msgid "Thank you." +msgstr "" + +#: includes/admin/views/html-admin-settings.php:23 +msgid "Save Changes" +msgstr "" + +#: includes/admin/views/html-notice-requirement-wp.php:9 +#, php-format +msgid "" +"Sorry, %s requires WordPress %s or higher. Please upgrade " +"your WordPress setup." msgstr "" #: includes/admin/views/html-notice-theme-support.php:10 @@ -245,16 +285,22 @@ msgstr "" msgid "Hide this notice" msgstr "" -#: template/content-partial.php:21 +#: includes/admin/wp-update-php/WPUpdatePhp.php:47 +#, php-format +msgid "" +"Unfortunately, %s can not run on PHP versions older than " +msgstr "" + +#: template/content-partial.php:53 msgid "Post navigation" msgstr "" -#: template/content-partial.php:23 +#: template/content-partial.php:55 msgctxt "Previous post link" msgid "←" msgstr "" -#: template/content-partial.php:24 +#: template/content-partial.php:56 msgctxt "Next post link" msgid "→" msgstr "" diff --git a/readme.txt b/readme.txt index a2c8bd4..d191afe 100644 --- a/readme.txt +++ b/readme.txt @@ -1,56 +1,72 @@ -=== Auto Load Next Post === +=== Auto Load Next Post === Contributors: sebd86 -Donate link: https://www.sebastiendumont.com/donation/ +Donate link: https://donorbox.org/auto-load-next-post Tags: auto load posts, scroll, scroll posts, post scroller, scrolling, infinite scroll, AJAX, endless, history, post history, browsing history Requires at least: 4.0 -Tested up to: 4.2.3 -Stable tag: 1.4.2 +Tested up to: 4.3.1 +Stable tag: 1.4.3 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html -Simply auto loads the previous post as you scroll down the page. Also changes the URL address and the page title from that post. +Simply auto loads the next post as you scroll down the page. Also changes the browser URL address and page title from the next post. == Description == -Have you ever felt tired of going back and forth between blog posts? I know I have so I decided to develop a solution. One where you would need to do very little coding and require very little to set up on your blog. +Have you ever felt tired of going back and forth between blog posts? I know I have so I developed a solution, one where you would need no coding or very little required to set up on your blog. -[youtube https://www.youtube.com/watch?v=EvBCPXVe2U4] += What is Auto Load Next Post? = +Auto Load Next Post loads the next post once the bottom of the first post the user visits has been reached. The process is repeated until there are no more posts to load. + +It simply reads the post navigation in the theme at the end of each post and collects the post URL for the next post / page. WordPress will then do a partial load and place the content of the next post underneath the parent post / page. -= What is it? = -Auto Load Next Post is a lightweight plugin that simply loads the previous post, one after another as you scroll down the page. It simply reads the post navigation in your theme at the end of each post and collects the post URL for the previous post. WordPress will then do a partial load and place the content of the previous post underneath the parent post. +Not only that, it updates your web history by manipulating the web address and page title. This allows you to return to any post you have looked at in your browser history. When you refresh the browser, it will load the post / page the user was viewing last. + +[youtube https://www.youtube.com/watch?v=EvBCPXVe2U4] -Not only that, it updates your web history by manipulating the web address and page title. This allows you to return to any post you have looked at in your browser history. When you refresh the page, the page will take you to the post you were viewing last. += First Time Users = +For new first time users I suggest reading [the documentation](https://github.com/seb86/Auto-Load-Next-Post/wiki) to understand how to setup the plugin and see how it works. By default when the plugin is activated, the settings are ready to be used with the latest WordPress core theme, Twenty Fifteen. = Features = -* Can use action hooks to load content before and after the next post has loaded. -* Can restrict it to load only on specific post types. +* Use action hooks to load content before and after the next post has loaded. +* Restrict it to load only on specific post types. * Have the option to hide the comments if you wish. * Track each post load with Google Analytics. ( Requires Google Analytics to be applied for this to work. ) +* Over-writable template file. -= Documentation = -Documentation, for this plugin, can be found at the GitHub repository [Wiki](https://github.com/seb86/Auto-Load-Next-Post/wiki). +> #### Auto Load Next Post Premium +> There's an even better version of the plugin coming out soon with priority email support.
    +> +> [More information](https://www.sebastiendumont.com/plugins/auto-load-next-post-premium/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=after-features-info-link) | [Sign up to be notified >>](http://eepurl.com/bvLz2H) -= Contributing and reporting bugs = -You can [contribute code](https://github.com/seb86/Auto-Load-Next-Post/blob/master/CONTRIBUTING.md) to this plugin via the [GitHub](https://github.com/seb86/Auto-Load-Next-Post/blob/master/CONTRIBUTING.md) repository and localizations via [Transifex](https://www.transifex.com/projects/p/auto-load-next-post/) += Contributing = +You can [contribute code](https://github.com/seb86/Auto-Load-Next-Post/blob/master/CONTRIBUTING.md) to this plugin via the [GitHub](https://github.com/seb86/Auto-Load-Next-Post/blob/master/CONTRIBUTING.md) repository and localizations via [Transifex](https://www.transifex.com/projects/p/auto-load-next-post/). = Forum Support and Issue Reporting = -Use the WordPress.org forums for [community support](https://wordpress.org/support/plugin/auto-load-next-post). I will do my best to respond. You may get or see a response from someone who has a similar issue already posted. If you spot a bug within the plugin, you can of course log it as an [issue](https://github.com/seb86/Auto-Load-Next-Post/issues) on [Github](https://github.com/seb86/Auto-Load-Next-Post/issues) instead where I can act upon it more efficiently. +Use the WordPress.org forum for [community support](https://wordpress.org/support/plugin/auto-load-next-post). As this is a free plugin I can not provide support full time but I will do my best to respond. You are most likely to get a response from a none developer. -If you need help with any customizations for this plugin. Please consider [hiring me](http://www.sebastiendumont.com/hire-me/) to apply them. +You may also find that a topic similar to yours has already been posted so join in rather than creating a new support ticket with the same issue. + +If you spot a bug within the plugin, you can of course log it as an [issue](https://github.com/seb86/Auto-Load-Next-Post/issues) on Github where I can act upon it more efficiently. + +If you need help with any customizations for this plugin. Please [hire me](http://www.sebastiendumont.com/hire-me/) to apply them for you. = Demo Site = -Want to try it out? [Go to the demo site](http://demos.sebastiendumont.com/auto-load-next-post/) and view a post. Scroll down and see the plugin in action. +Want to try it out? [Go to the demo site](http://demo.autoloadnextpost.com) and view a post. Scroll down and see the plugin in action. + += Support by Donating = +Donations of any sum help keep this plugin actively developed and supported. Your support goes along way in making this plugin better. (Make a Donation)[https://donorbox.org/auto-load-next-post] -= Support the plugin by Donations and Reviews = -To keep this plugin working and support as many themes as possible, please consider making a [donation](https://www.sebastiendumont.com/donation/) or [write a review](https://wordpress.org/support/view/plugin-reviews/auto-load-next-post?rate=5#postform) about it. += Leave a Review = +Reviews are helpful to other users and this plugin reputation. Please consider spending a minute or two leaving a [review](https://wordpress.org/support/view/plugin-reviews/auto-load-next-post?rate=5#postform) and tell me what you think about the plugin. It matters a lot and is most appreciated. -= Languages = -Auto Load Next Post is currently available in 3 languages with more on the way. The folks over at WP Translations handle the translations, and it's because of them that these translations are available. More are on the way and with your help they can be released quicker. If you would like to help translate, go to the [Transifex](https://www.transifex.com/projects/p/auto-load-next-post/) project. += Languages and Translation Support = +Current languages available: English(US), Français (French)(France), German (Germany), Româna (Romanian) -**Current Translations Available** +Auto Load Next Post is currently available in 4 languages with more on the way. The folks over at WP Translations handle the translations, and it's because of them that these translations are available. More are on the way and with your help they can be released quicker. If you would like to help translate, go to the [Transifex](https://www.transifex.com/projects/p/auto-load-next-post/) project. -- English (US) -- Français (French)(France) -- Română (Romanian) +> #### PHP Requirement +> This plugin requires PHP version 5.3 or higher.
    +> If you're still at PHP 5.2, it's time to update. [Read here why and how](http://www.wpupdatephp.com/update/)
    +> Updating to a newer PHP version is almost always done in minutes and free of charge! **More information** @@ -65,9 +81,9 @@ Installing "Auto Load Next Post" can be done either by searching for "Auto Load 2. Upload the ZIP file through the 'Plugins > Add New > Upload' screen in your WordPress dashboard. 3. Activate the plugin through the 'Plugins' menu in WordPress. 4. Go to the plugin settings page 'Settings > Auto Load Next Post'. -5. Enter each of the containers specified in the theme you are using and press "Save". +5. Enter each of the containers specified for the theme you are using and press "Save Changes". -Once you have activated the plugin, you may get an admin notice telling you that you have not declared support for the plugin. This is perfectly normal and with a little setting up, the notification will remove automatically. There are two buttons. The first leads you to documentation to help you support the plugin. The second allows you to force hide the admin notice. +Once you have activated the plugin, you may get an admin notice telling you that you have not declared support for the plugin. This is perfectly normal and with a little setting up, the notification will remove automatically. There are two buttons. The first leads you to documentation to help you support the plugin. The second allows you to force hide the admin notice. - This notification does not show for any of WordPress core themes. See [documentation](https://github.com/seb86/Auto-Load-Next-Post/wiki) for more information. @@ -85,9 +101,17 @@ A.2 Yes you can. Simply create a new folder in your theme like so, ```your-theme A.3 I am working on it! :) -= Q.4 After the first post has loaded, all I get is the same post over and over again. Why is that? += Q.4 After the first post has loaded, all I get is the same post over and over again. Why is that? = -A.4 This is because when you created your own `content-partial.php` file, you placed the post navigation outside of the post query. You need to place it inside the loop. This will solve the problem. +A.4 If you created your own `content-partial.php` file, you may have placed the post navigation outside of the post query. You need to place it inside the loop. This will solve the problem. + += Q.5 Does the plugin detect my theme and insert the correct selectors for me? = + +A.5 No it does not, but this will be available in the premium version. + += Q.6 I'm confused about the post order. Why is the plugin called "Auto Load Next Post"? = + +A.6 Well, WordPress loads posts in descending order by default so the next post is the previous post and a user reads content going down not up so it loads the next post, not previous. == Screenshots == 1. Admin Settings Page @@ -95,6 +119,28 @@ A.4 This is because when you created your own `content-partial.php` file, you pl == Changelog == += 1.4.3 : 20th October 2015 = +* Corrected undefined function for Google Analytics tracking in the JavaScript. +* Improved Google Analytics. Now detects old, classic, current and Yoast method of tracking pageviews. +* Changed the default content container setting to match Twenty Fifteen. +* Core themes are supported except for Twenty Eleven. Theme notification only shows now if not a core theme. +* Corrected a loading issue of the template file should the theme have one also. +* Improved the partial content template file. Now has a fallback. Should be more compatible with themes. +* Added a support tab to the plugin settings page. +* Added a upgrade link on the plugins page. +* Added a community support link on the plugins page. +* Added the German translation. +* Redefined the constants. +* Moved admin functions under the directory 'includes/admin' +* Moved library assets under a new folder for both CSS and JavaScript. +* Added PHP detection. +* Improved copy in the settings page and the help tab. +* Updated the default localization file. +* Removed public variables and hardcoded them into the plugin instead. +* Removed whitespace. +* Removed @return void on __construct() functions. +* Cleaned up the code. + = 1.4.2 : 31st July 2015 = * Added two languages for localizing the plugin settings page. Français (French)(France) and Română (Romanian). @@ -121,5 +167,5 @@ A.4 This is because when you created your own `content-partial.php` file, you pl * Initial version == Upgrade Notice == -= 1.4.2 : 31st July 2015 = -* Added two languages for localizing the plugin settings page. Français (French)(France) and Română (Romanian). += 1.4.3 : 18th August 2015 = +* Corrected undefined function for Google Analytics tracking in the JavaScript. diff --git a/template/content-partial.php b/template/content-partial.php index 353f9b4..bb4518a 100644 --- a/template/content-partial.php +++ b/template/content-partial.php @@ -1,8 +1,11 @@

    - ' . _x( '←', 'Previous post link', 'auto-load-next-post' ) . ' %title' ); ?> - ' . _x( '→', 'Next post link', 'auto-load-next-post' ) . '' ); ?> + '._x( '←', 'Previous post link', 'auto-load-next-post' ).' %title' ); ?> + '._x( '→', 'Next post link', 'auto-load-next-post' ).'' ); ?> Date: Tue, 20 Oct 2015 01:10:05 +0200 Subject: [PATCH 2/5] Removed whitespace. --- assets/js/frontend/auto-load-next-post.js | 56 +++---- auto-load-next-post.php | 120 +++++++------- ...s-auto-load-next-post-admin-activation.php | 14 +- .../class-auto-load-next-post-admin-help.php | 28 ++-- .../class-auto-load-next-post-admin-menus.php | 10 +- ...lass-auto-load-next-post-admin-notices.php | 26 +-- ...ass-auto-load-next-post-admin-settings.php | 152 +++++++++--------- .../admin/class-auto-load-next-post-admin.php | 66 ++++---- .../class-auto-load-next-post-install.php | 10 +- ...s-auto-load-next-post-settings-general.php | 56 +++---- ...lass-auto-load-next-post-settings-page.php | 10 +- ...s-auto-load-next-post-settings-support.php | 26 +-- includes/admin/views/html-admin-settings.php | 8 +- .../views/html-notice-requirement-wp.php | 2 +- .../admin/views/html-notice-theme-support.php | 6 +- includes/admin/wp-update-php/WPUpdatePhp.php | 10 +- ...o-load-next-post-conditional-functions.php | 12 +- .../auto-load-next-post-core-functions.php | 18 +-- ...to-load-next-post-formatting-functions.php | 2 +- readme.txt | 2 +- template/content-partial.php | 28 ++-- uninstall.php | 6 +- 22 files changed, 333 insertions(+), 335 deletions(-) diff --git a/assets/js/frontend/auto-load-next-post.js b/assets/js/frontend/auto-load-next-post.js index 4cf0ee5..04f89c3 100644 --- a/assets/js/frontend/auto-load-next-post.js +++ b/assets/js/frontend/auto-load-next-post.js @@ -11,20 +11,20 @@ jQuery.noConflict(); jQuery( document ).ready( function() { // Don't do this if looking for comments - if ( window.location.href.indexOf( '#comments' ) > -1 ) { + if(window.location.href.indexOf( '#comments' ) > -1 ) { return; } // It's up to you if you want to hide the comments. If the answer is yes then the comments will be gone. - if ( remove_comments === 'yes' ) { + if(remove_comments === 'yes' ) { jQuery( comments_container ).remove(); // Remove Comments - if ( jQuery( comments_container ).length <= 0 ) { - console.log( 'Comments Removed' ); + if(jQuery( comments_container ).length <= 0 ) { + console.log( 'Comments Removed'); } } // Add a divider - jQuery( content_container ).prepend( '
    ' ); + jQuery( content_container ).prepend( '
    '); // Initialise Scrollspy initialise_scrollspy(); @@ -53,7 +53,7 @@ function history(){ History.Adapter.bind(window,'statechange',function(){ // Note: We are using statechange instead of popstate var State = History.getState(); // Note: We are using History.getState() instead of event.state - if ( State.url != curr_url ) { + if(State.url != curr_url ) { window.location.reload(State.url); } }); @@ -67,13 +67,13 @@ function changeURL() { var scrollTop = jQuery(document).scrollTop(); // If exiting or entering from top, change URL - if ( ( offset.top - scrollTop ) < 150 && curr_url != this_url ) { + if(( offset.top - scrollTop ) < 150 && curr_url != this_url ) { curr_url = this_url; History.pushState(null, null, this_url); window.document.title = this_title; - if ( track_pageviews == 'yes' ) { - console.log( 'Google Analytics Tracking Enabled' ); + if(track_pageviews == 'yes' ) { + console.log( 'Google Analytics Tracking Enabled'); update_google_analytics(); } // END if track_pageviews } @@ -93,8 +93,8 @@ function changeURL() { * Also supports Google Analytics by Yoast should it be used. */ function update_google_analytics() { - if ( typeof pageTracker === "undefined" || typeof _gaq === 'undefined' || typeof ga === 'undefined' || typeof __gaTracker === 'undefined' ) { - console.error( 'Google Analytics is not installed!' ); + if(typeof pageTracker === "undefined" || typeof _gaq === 'undefined' || typeof ga === 'undefined' || typeof __gaTracker === 'undefined' ) { + console.error( 'Google Analytics is not installed!'); return; } @@ -102,26 +102,26 @@ function update_google_analytics() { console.log( 'Track: ' + track_page_url ); // This uses Asynchronous version of Google Analytics tracking method. - if ( typeof pageTracker !== "undefined" && pageTracker !== null ) { - console.log( 'Google Analytics is installed, but old.' ); + if(typeof pageTracker !== "undefined" && pageTracker !== null ) { + console.log( 'Google Analytics is installed, but old.'); pageTracker._trackPageview( track_page_url ); } // This uses Google's classic Google Analytics tracking method. - if ( typeof _gaq !== 'undefined' && _gaq !== null ) { - console.log( 'Google Analytics is installed. Yahoo!' ); + if(typeof _gaq !== 'undefined' && _gaq !== null ) { + console.log( 'Google Analytics is installed. Yahoo!'); _gaq.push(['_trackPageview', track_page_url]); } // This uses Google Analytics Universal Analytics tracking method. - if ( typeof ga !== 'undefined' && _ga !== null ) { - console.log( 'Google Analytics Universal Analytics is installed. Yahoo!' ); + if(typeof ga !== 'undefined' && _ga !== null ) { + console.log( 'Google Analytics Universal Analytics is installed. Yahoo!'); ga('send', 'pageview', track_page_url); } // This uses Yoast's method of tracking Google Analytics. - if ( typeof __gaTracker !== 'undefined' && __gaTracker !== null ) { - console.log( 'Google Analytics by Yoast is installed. Awesome!' ); + if(typeof __gaTracker !== 'undefined' && __gaTracker !== null ) { + console.log( 'Google Analytics by Yoast is installed. Awesome!'); __gaTracker('send', 'pageview', track_page_url); } } // END update_google_analytics() @@ -135,22 +135,22 @@ function auto_load_next_post() { // For some browsers, `post_url` is undefined; for others, // `post_url` is false. So we check for both possibilites. - if ( typeof post_url !== typeof undefined && post_url !== false ) { - console.log( 'Post URL was defined. All is good.' ); + if(typeof post_url !== typeof undefined && post_url !== false ) { + console.log( 'Post URL was defined. All is good.'); console.log( 'Next Post URL: ' + post_url ); } else { - console.error( 'Post URL was not defined. Oh dear!' ); + console.error( 'Post URL was not defined. Oh dear!'); } - if ( !post_url ) return; + if(!post_url ) return; // Check to see if pretty permalinks, if not then add partial=1 - if ( post_url.indexOf( '?p=' ) > -1 ) { + if(post_url.indexOf( '?p=' ) > -1 ) { np_url = post_url + '&partial=1' } else { var partial_endpoint = 'partial/'; - if ( post_url.charAt(post_url.length - 1) != '/' ) + if(post_url.charAt(post_url.length - 1) != '/' ) partial_endpoint = '/' + partial_endpoint; np_url = post_url + partial_endpoint; @@ -158,8 +158,8 @@ function auto_load_next_post() { // Remove the post navigation HTML once the next post has loaded. jQuery( nav_container ).remove(); - if ( jQuery( nav_container ).length <= 0 ) { - console.log( 'Post Navigation Removed!' ); + if(jQuery( nav_container ).length <= 0 ) { + console.log( 'Post Navigation Removed!'); } jQuery.get( np_url , function( data ) { @@ -175,7 +175,7 @@ function auto_load_next_post() { jQuery( content_container ).append( post_html ); // Add next post // get the HR element and add the data-title - jQuery( 'hr[data-url="' + post_url + '"]').attr( 'data-title' , post_title.text() ).css( 'display', 'inline-block' ); + jQuery( 'hr[data-url="' + post_url + '"]').attr( 'data-title' , post_title.text() ).css( 'display', 'inline-block'); // need to set up ScrollSpy on new content scrollspy(); diff --git a/auto-load-next-post.php b/auto-load-next-post.php index 9fc9ed4..9989573 100644 --- a/auto-load-next-post.php +++ b/auto-load-next-post.php @@ -29,9 +29,9 @@ * @package Auto_Load_Next_Post * @author Sébastien Dumont */ -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly +if(! defined('ABSPATH')) exit; // Exit if accessed directly -if ( ! class_exists( 'Auto_Load_Next_Post' ) ) { +if(! class_exists('Auto_Load_Next_Post')){ /** * Main Auto Load Next Post Class @@ -60,7 +60,7 @@ final class Auto_Load_Next_Post { * @return Auto Load Next Post instance */ public static function instance() { - if ( is_null( self::$_instance ) ) { + if(is_null(self::$_instance)){ self::$_instance = new Auto_Load_Next_Post; self::$_instance->setup_constants(); self::$_instance->load_plugin_textdomain(); @@ -81,7 +81,7 @@ public static function instance() { */ public function __clone() { // Cloning instances of the class is forbidden - _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'auto-load-next-post' ), AUTO_LOAD_NEXT_POST_VERSION ); + _doing_it_wrong(__FUNCTION__, __('Cheatin’ huh?', 'auto-load-next-post'), AUTO_LOAD_NEXT_POST_VERSION); } // END __clone() /** @@ -93,7 +93,7 @@ public function __clone() { */ public function __wakeup() { // Unserializing instances of the class is forbidden - _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'auto-load-next-post' ), AUTO_LOAD_NEXT_POST_VERSION ); + _doing_it_wrong(__FUNCTION__, __('Cheatin’ huh?', 'auto-load-next-post'), AUTO_LOAD_NEXT_POST_VERSION); } // END __wakeup() /** @@ -104,14 +104,14 @@ public function __wakeup() { */ public function __construct() { // Auto-load classes on demand - if ( function_exists( "__autoload" ) ) - spl_autoload_register( "__autoload" ); + if(function_exists("__autoload")) + spl_autoload_register("__autoload"); - spl_autoload_register( array( $this, 'autoload' ) ); + spl_autoload_register(array($this, 'autoload')); // Hooks - add_action( 'init', array( $this, 'init_auto_load_next_post' ), 0 ); - add_action( 'wp_enqueue_scripts', array( $this, 'front_scripts_and_styles' ) ); + add_action('init', array($this, 'init_auto_load_next_post'), 0); + add_action('wp_enqueue_scripts', array($this, 'front_scripts_and_styles')); } // END __construct() /** @@ -122,18 +122,18 @@ public function __construct() { * @param mixed $class * @return void */ - public function autoload( $class ) { + public function autoload($class) { $path = null; - $file = strtolower( 'class-'.str_replace( '_', '-', $class ) ).'.php'; + $file = strtolower('class-'.str_replace('_', '-', $class)).'.php'; - if ( strpos( $class, 'auto_load_next_post_admin' ) === 0 ) { + if(strpos($class, 'auto_load_next_post_admin' ) === 0){ $path = AUTO_LOAD_NEXT_POST_FILE_PATH.'/includes/admin/'; - } else if ( strpos( $class, 'auto_load_next_post_' ) === 0 ) { + }else if(strpos( $class, 'auto_load_next_post_' ) === 0){ $path = AUTO_LOAD_NEXT_POST_FILE_PATH.'/includes/'; } - if ( $path !== null && is_readable( $path.$file ) ) { - include_once( $path.$file ); + if($path !== null && is_readable( $path.$file)){ + include_once($path.$file); return true; } } // END autoload() @@ -145,18 +145,18 @@ public function autoload( $class ) { * @access private */ private function setup_constants() { - $this->define( 'AUTO_LOAD_NEXT_POST_VERSION', '1.4.3' ); - $this->define( 'AUTO_LOAD_NEXT_POST_FILE', __FILE__ ); - $this->define( 'AUTO_LOAD_NEXT_POST_SLUG', 'auto-load-next-post' ); + $this->define('AUTO_LOAD_NEXT_POST_VERSION', '1.4.3'); + $this->define('AUTO_LOAD_NEXT_POST_FILE', __FILE__); + $this->define('AUTO_LOAD_NEXT_POST_SLUG', 'auto-load-next-post'); - $this->define( 'AUTO_LOAD_NEXT_POST_URL_PATH', untrailingslashit( plugins_url( '/', __FILE__ ) ) ); - $this->define( 'AUTO_LOAD_NEXT_POST_FILE_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) ); - $this->define( 'AUTO_LOAD_NEXT_POST_TEMPLATE_PATH', 'auto-load-next-post/' ); + $this->define('AUTO_LOAD_NEXT_POST_URL_PATH', untrailingslashit(plugins_url('/', __FILE__))); + $this->define('AUTO_LOAD_NEXT_POST_FILE_PATH', untrailingslashit(plugin_dir_path(__FILE__))); + $this->define('AUTO_LOAD_NEXT_POST_TEMPLATE_PATH', 'auto-load-next-post/'); - $this->define( 'AUTO_LOAD_NEXT_POST_WP_VERSION_REQUIRE', '4.0' ); + $this->define('AUTO_LOAD_NEXT_POST_WP_VERSION_REQUIRE', '4.0'); - $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; - $this->define( 'AUTO_LOAD_NEXT_POST_SCRIPT_MODE', $suffix ); + $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min'; + $this->define('AUTO_LOAD_NEXT_POST_SCRIPT_MODE', $suffix); } // END setup_constants() /** @@ -167,9 +167,9 @@ private function setup_constants() { * @access private * @since 1.4.3 */ - private function define( $name, $value ) { - if ( ! defined( $name ) ) { - define( $name, $value ); + private function define($name, $value){ + if( ! defined($name)) { + define($name, $value); } } @@ -181,10 +181,10 @@ private function define( $name, $value ) { * @return void */ public function includes() { - include_once( 'includes/auto-load-next-post-core-functions.php' ); // Contains core functions for the front/back end. + include_once('includes/auto-load-next-post-core-functions.php'); // Contains core functions for the front/back end. - if ( is_admin() ) { - include_once( 'includes/admin/class-auto-load-next-post-admin.php' ); // Admin section + if(is_admin()){ + include_once('includes/admin/class-auto-load-next-post-admin.php'); // Admin section } } // END includes() @@ -195,7 +195,7 @@ public function includes() { * @access public */ public function init_auto_load_next_post() { - add_rewrite_endpoint( 'partial', EP_PERMALINK ); + add_rewrite_endpoint('partial', EP_PERMALINK); // Refresh permalinks flush_rewrite_rules(); @@ -215,28 +215,28 @@ public function init_auto_load_next_post() { */ public function load_plugin_textdomain() { // Set filter for plugin's languages directory - $lang_dir = dirname( plugin_basename( AUTO_LOAD_NEXT_POST_FILE ) ).'/languages/'; - $lang_dir = apply_filters( 'auto_load_next_post_languages_directory', $lang_dir ); + $lang_dir = dirname(plugin_basename(AUTO_LOAD_NEXT_POST_FILE)).'/languages/'; + $lang_dir = apply_filters('auto_load_next_post_languages_directory', $lang_dir); // Traditional WordPress plugin locale filter - $locale = apply_filters( 'plugin_locale', get_locale(), 'auto-load-next-post' ); - $mofile = sprintf( '%1$s-%2$s.mo', 'auto-load-next-post', $locale ); + $locale = apply_filters('plugin_locale', get_locale(), 'auto-load-next-post'); + $mofile = sprintf('%1$s-%2$s.mo', 'auto-load-next-post', $locale); // Setup paths to current locale file $mofile_local = $lang_dir.$mofile; $mofile_global = WP_LANG_DIR.'/auto-load-next-post/'.$mofile; - if ( file_exists( $mofile_global ) ) { + if(file_exists( $mofile_global)){ // Look in global /wp-content/languages/auto-load-next-post/ folder - load_textdomain( 'auto-load-next-post', $mofile_global ); + load_textdomain('auto-load-next-post', $mofile_global); } - else if ( file_exists( $mofile_local ) ) { + else if(file_exists( $mofile_local)){ // Look in local /wp-content/plugins/auto-load-next-post/languages/ folder - load_textdomain( 'auto-load-next-post', $mofile_local ); + load_textdomain('auto-load-next-post', $mofile_local); } else { // Load the default language files - load_plugin_textdomain( 'auto-load-next-post', false, $lang_dir ); + load_plugin_textdomain('auto-load-next-post', false, $lang_dir); } } // END load_plugin_textdomain() @@ -254,19 +254,19 @@ public function front_scripts_and_styles() { * Load Javascript if found as a singluar post either, * single or page and is one of the selected post types. */ - if ( supports_alnp() && is_singular() && in_array( get_post_type(), get_option( 'auto_load_next_post_get_post_types' ) ) ) { - $this->load_file( 'auto-load-next-post-scrollspy', '/assets/js/libs/scrollspy'.AUTO_LOAD_NEXT_POST_SCRIPT_MODE.'.js', true, array('jquery'), AUTO_LOAD_NEXT_POST_VERSION ); - $this->load_file( 'auto-load-next-post-history', '/assets/js/libs/jquery.history.js', true, array('jquery'), AUTO_LOAD_NEXT_POST_VERSION ); - $this->load_file( 'auto-load-next-post-script', '/assets/js/frontend/auto-load-next-post'.AUTO_LOAD_NEXT_POST_SCRIPT_MODE.'.js', true, array( 'auto-load-next-post-scrollspy' ), AUTO_LOAD_NEXT_POST_VERSION ); + if(supports_alnp() && is_singular() && in_array(get_post_type(), get_option('auto_load_next_post_get_post_types'))){ + $this->load_file('auto-load-next-post-scrollspy', '/assets/js/libs/scrollspy'.AUTO_LOAD_NEXT_POST_SCRIPT_MODE.'.js', true, array('jquery'), AUTO_LOAD_NEXT_POST_VERSION); + $this->load_file('auto-load-next-post-history', '/assets/js/libs/jquery.history.js', true, array('jquery'), AUTO_LOAD_NEXT_POST_VERSION); + $this->load_file('auto-load-next-post-script', '/assets/js/frontend/auto-load-next-post'.AUTO_LOAD_NEXT_POST_SCRIPT_MODE.'.js', true, array('auto-load-next-post-scrollspy'), AUTO_LOAD_NEXT_POST_VERSION); // Variables for JS scripts - wp_localize_script( 'auto-load-next-post-script', 'auto_load_next_post_params', array( - 'alnp_content_container' => get_option( 'auto_load_next_post_content_container' ), - 'alnp_title_selector' => get_option( 'auto_load_next_post_title_selector' ), - 'alnp_navigation_container' => get_option( 'auto_load_next_post_navigation_container' ), - 'alnp_comments_container' => get_option( 'auto_load_next_post_comments_container' ), - 'alnp_remove_comments' => get_option( 'auto_load_next_post_remove_comments' ), - 'alnp_google_analytics' => get_option( 'auto_load_next_post_google_analytics' ), + wp_localize_script('auto-load-next-post-script', 'auto_load_next_post_params', array( + 'alnp_content_container' => get_option('auto_load_next_post_content_container'), + 'alnp_title_selector' => get_option('auto_load_next_post_title_selector'), + 'alnp_navigation_container' => get_option('auto_load_next_post_navigation_container'), + 'alnp_comments_container' => get_option('auto_load_next_post_comments_container'), + 'alnp_remove_comments' => get_option('auto_load_next_post_remove_comments'), + 'alnp_google_analytics' => get_option('auto_load_next_post_google_analytics'), ) ); } // END if is_singular() && get_post_type() } // END register_scripts_and_styles() @@ -283,19 +283,19 @@ public function front_scripts_and_styles() { * @param string $version Optional, can match the version of the plugin or version of the source file. * @global string $wp_version */ - public static function load_file( $name, $file_path, $is_script = false, $support = array(), $version = '' ) { + public static function load_file($name, $file_path, $is_script = false, $support = array(), $version = '') { global $wp_version; - $url = AUTO_LOAD_NEXT_POST_URL_PATH.$file_path; // URL to the file. + $url = AUTO_LOAD_NEXT_POST_URL_PATH.$file_path; // URL to the file. - if ( file_exists( AUTO_LOAD_NEXT_POST_FILE_PATH.$file_path ) ) { - if ( $is_script ) { - wp_register_script( $name, $url, $support, $version ); - wp_enqueue_script( $name ); + if(file_exists(AUTO_LOAD_NEXT_POST_FILE_PATH.$file_path)){ + if($is_script){ + wp_register_script($name, $url, $support, $version); + wp_enqueue_script($name); } else { - wp_register_style( $name, $url ); - wp_enqueue_style( $name ); + wp_register_style($name, $url); + wp_enqueue_style($name); } // end if } // end if diff --git a/includes/admin/class-auto-load-next-post-admin-activation.php b/includes/admin/class-auto-load-next-post-admin-activation.php index 304ea16..10d5a93 100644 --- a/includes/admin/class-auto-load-next-post-admin-activation.php +++ b/includes/admin/class-auto-load-next-post-admin-activation.php @@ -9,9 +9,9 @@ * @license GPL-2.0+ */ -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly +if(! defined('ABSPATH')) exit; // Exit if accessed directly -if ( ! class_exists( 'Auto_Load_Next_Post_Activation' ) ) { +if(! class_exists('Auto_Load_Next_Post_Activation')){ /** * Auto_Load_Next_Post_Activation Class @@ -26,12 +26,12 @@ class Auto_Load_Next_Post_Activation { */ public function __construct() { // Fetch the Php version checker. - require_once( 'wp-update-php/WPUpdatePhp.php' ); - $updatePhp = new WPUpdatePhp( '5.3.0' ); + require_once( 'wp-update-php/WPUpdatePhp.php'); + $updatePhp = new WPUpdatePhp( '5.3.0'); // If the miniumum version of PHP required is available then install the plugin. - if ( $updatePhp->does_it_meet_required_php_version( PHP_VERSION ) ) { - add_action( 'plugins_loaded', array( $this, 'run_activation' ) ); + if($updatePhp->does_it_meet_required_php_version( PHP_VERSION)){ + add_action('plugins_loaded', array($this, 'run_activation' ) ); } else { // If the required PHP version is not avaialble then deactivate the plugin. deactivate_plugins( plugin_basename( AUTO_LOAD_NEXT_POST_FILE ) ); @@ -46,7 +46,7 @@ public function __construct() { * @since 1.0.0 */ public function run_activation(){ - include_once( 'class-auto-load-next-post-install.php' ); + include_once('class-auto-load-next-post-install.php'); $install_plugin = new Auto_Load_Next_Post_Install; $install_plugin->install(); } diff --git a/includes/admin/class-auto-load-next-post-admin-help.php b/includes/admin/class-auto-load-next-post-admin-help.php index d91f778..f464ff4 100644 --- a/includes/admin/class-auto-load-next-post-admin-help.php +++ b/includes/admin/class-auto-load-next-post-admin-help.php @@ -9,9 +9,9 @@ * @license GPL-2.0+ */ -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly +if(! defined('ABSPATH')) exit; // Exit if accessed directly -if ( ! class_exists( 'Auto_Load_Next_Post_Admin_Help' ) ) { +if(! class_exists('Auto_Load_Next_Post_Admin_Help')){ /** * Class - Auto_Load_Next_Post_Admin_Help @@ -27,7 +27,7 @@ class Auto_Load_Next_Post_Admin_Help { * @access public */ public function __construct() { - add_action( 'current_screen', array( $this, 'add_help_tabs' ), 50 ); + add_action('current_screen', array($this, 'add_help_tabs' ), 50 ); } // END __construct() /** @@ -39,30 +39,30 @@ public function __construct() { public function add_help_tabs() { $screen = get_current_screen(); - if ( $screen->id != 'settings_page_auto-load-next-post-settings' ) + if($screen->id != 'settings_page_auto-load-next-post-settings' ) return; $screen->add_help_tab( array( 'id' => 'auto_load_next_post_docs_tab', - 'title' => __( 'Documentation', 'auto-load-next-post' ), + 'title' => __('Documentation', 'auto-load-next-post'), 'content' => - '

    '.sprintf( __( 'Thank you for using %1$s :) Should you need help using %1$s please read the documentation.', 'auto-load-next-post' ), 'Auto Load Next Post' ).'

    ' . - '

    '.sprintf( __( '%s Documentation', 'auto-load-next-post' ), 'Auto Load Next Post' ).'

    ' + '

    '.sprintf( __('Thank you for using %1$s :) Should you need help using %1$s please read the documentation.', 'auto-load-next-post'), 'Auto Load Next Post' ).'

    ' . + '

    '.sprintf( __('%s Documentation', 'auto-load-next-post'), 'Auto Load Next Post' ).'

    ' ) ); $screen->add_help_tab( array( 'id' => 'auto_load_next_post_bugs_tab', - 'title' => __( 'Found a bug?', 'auto-load-next-post' ), + 'title' => __('Found a bug?', 'auto-load-next-post'), 'content' => - '

    '.sprintf( __( 'If you find a bug within %s you can create a ticket via Github issues. Ensure you read the contribution guide prior to submitting your report. Be as descriptive as possible. Thank you.', 'auto-load-next-post' ), 'Auto Load Next Post', 'https://github.com/seb86/Auto-Load-Next-Post/issues?state=open', 'https://github.com/seb86/Auto-Load-Next-Post/blob/master/CONTRIBUTING.md' ).'

    ' . - '

    '.__( 'Report a bug', 'auto-load-next-post' ).'

    ' + '

    '.sprintf( __('If you find a bug within %s you can create a ticket via Github issues. Ensure you read the contribution guide prior to submitting your report. Be as descriptive as possible. Thank you.', 'auto-load-next-post'), 'Auto Load Next Post', 'https://github.com/seb86/Auto-Load-Next-Post/issues?state=open', 'https://github.com/seb86/Auto-Load-Next-Post/blob/master/CONTRIBUTING.md' ).'

    ' . + '

    '.__('Report a bug', 'auto-load-next-post').'

    ' ) ); $screen->set_help_sidebar( - '

    '.__( 'For more information:', 'auto-load-next-post' ).'

    ' . - '

    '.sprintf( __( 'About %s', 'auto-load-next-post' ), 'Auto Load Next Post' ).'

    ' . - '

    '.__( 'Project on WordPress.org', 'auto-load-next-post' ).'

    ' . - '

    '.__( 'Project on Github', 'auto-load-next-post' ).'

    ' + '

    '.__('For more information:', 'auto-load-next-post').'

    ' . + '

    '.sprintf( __('About %s', 'auto-load-next-post'), 'Auto Load Next Post' ).'

    ' . + '

    '.__('Project on WordPress.org', 'auto-load-next-post').'

    ' . + '

    '.__('Project on Github', 'auto-load-next-post').'

    ' ); } // END add_help_tabs() diff --git a/includes/admin/class-auto-load-next-post-admin-menus.php b/includes/admin/class-auto-load-next-post-admin-menus.php index 38cb55a..cd0385e 100644 --- a/includes/admin/class-auto-load-next-post-admin-menus.php +++ b/includes/admin/class-auto-load-next-post-admin-menus.php @@ -9,9 +9,9 @@ * @license GPL-2.0+ */ -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly +if(! defined('ABSPATH')) exit; // Exit if accessed directly -if ( ! class_exists( 'Auto_Load_Next_Post_Admin_Menus' ) ) { +if(! class_exists('Auto_Load_Next_Post_Admin_Menus')){ /** * Class - Auto_Load_Next_Post_Admin_Menus @@ -28,7 +28,7 @@ class Auto_Load_Next_Post_Admin_Menus { */ public function __construct() { // Add admin menus - add_action( 'admin_menu', array( $this, 'admin_menu' ), 9 ); + add_action('admin_menu', array($this, 'admin_menu' ), 9 ); } // END __construct() /** @@ -43,7 +43,7 @@ public function __construct() { public function admin_menu() { global $menu, $wp_version; - add_options_page( sprintf( __( '%s Settings', 'auto-load-next-post' ), 'Auto Load Next Post' ), 'Auto Load Next Post', 'manage_options', 'auto-load-next-post-settings', array( $this, 'settings_page' ) ); + add_options_page( sprintf( __('%s Settings', 'auto-load-next-post'), 'Auto Load Next Post' ), 'Auto Load Next Post', 'manage_options', 'auto-load-next-post-settings', array($this, 'settings_page' ) ); } // END admin_menu() /** @@ -52,7 +52,7 @@ public function admin_menu() { * @access public */ public function settings_page() { - include_once( 'class-auto-load-next-post-admin-settings.php' ); + include_once('class-auto-load-next-post-admin-settings.php'); Auto_Load_Next_Post_Admin_Settings::output(); } diff --git a/includes/admin/class-auto-load-next-post-admin-notices.php b/includes/admin/class-auto-load-next-post-admin-notices.php index 73f56d9..85075df 100644 --- a/includes/admin/class-auto-load-next-post-admin-notices.php +++ b/includes/admin/class-auto-load-next-post-admin-notices.php @@ -9,9 +9,9 @@ * @license GPL-2.0+ */ -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly +if(! defined('ABSPATH')) exit; // Exit if accessed directly -if ( ! class_exists( 'Auto_Load_Next_Post_Admin_Notices' ) ) { +if(! class_exists('Auto_Load_Next_Post_Admin_Notices')){ /** * Class - Auto_Load_Next_Post_Admin_Notices @@ -27,8 +27,8 @@ class Auto_Load_Next_Post_Admin_Notices { * @access public */ public function __construct() { - add_action( 'admin_init', array( $this, 'check_wp' ) ); - add_action( 'admin_init', array( $this, 'add_notices' ) ); + add_action('admin_init', array($this, 'check_wp' ) ); + add_action('admin_init', array($this, 'add_notices' ) ); } // END __construct() /** @@ -39,17 +39,17 @@ public function __construct() { * @access public */ public function add_notices() { - $template = get_option( 'template' ); + $template = get_option( 'template'); - if ( ! supports_alnp() ) { + if(! supports_alnp() ) { - if ( ! empty( $_GET['hide_auto_load_next_post_theme_support_check'] ) ) { + if(! empty( $_GET['hide_auto_load_next_post_theme_support_check'])){ update_option( 'auto_load_next_post_theme_support_check', $template ); return; } - if ( get_option( 'auto_load_next_post_theme_support_check' ) !== $template ) { - add_action( 'admin_notices', array( $this, 'theme_check_notice' ) ); + if(get_option( 'auto_load_next_post_theme_support_check' ) !== $template ) { + add_action('admin_notices', array($this, 'theme_check_notice' ) ); } } @@ -66,8 +66,8 @@ public function add_notices() { public function check_wp() { global $wp_version; - if ( ! version_compare( $wp_version, AUTO_LOAD_NEXT_POST_WP_VERSION_REQUIRE, '>=' ) ) { - add_action( 'admin_notices', array( $this, 'requirement_wp_notice' ) ); + if(! version_compare( $wp_version, AUTO_LOAD_NEXT_POST_WP_VERSION_REQUIRE, '>=')){ + add_action('admin_notices', array($this, 'requirement_wp_notice' ) ); return false; } @@ -81,7 +81,7 @@ public function check_wp() { * @access public */ public function requirement_wp_notice() { - include( 'views/html-notice-requirement-wp.php' ); + include('views/html-notice-requirement-wp.php'); } // END display_req_notice() /** @@ -91,7 +91,7 @@ public function requirement_wp_notice() { * @access public */ public function theme_check_notice() { - include( 'views/html-notice-theme-support.php' ); + include('views/html-notice-theme-support.php'); } // END theme_check_notice() } // END Auto_Load_Next_Post_Admin_Notices class. diff --git a/includes/admin/class-auto-load-next-post-admin-settings.php b/includes/admin/class-auto-load-next-post-admin-settings.php index 53c198f..d393d34 100644 --- a/includes/admin/class-auto-load-next-post-admin-settings.php +++ b/includes/admin/class-auto-load-next-post-admin-settings.php @@ -9,9 +9,9 @@ * @license GPL-2.0+ */ -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly +if(! defined('ABSPATH')) exit; // Exit if accessed directly -if ( ! class_exists( 'Auto_Load_Next_Post_Admin_Settings' ) ) { +if(! class_exists('Auto_Load_Next_Post_Admin_Settings')){ /** * Auto_Load_Next_Post_Admin_Settings @@ -32,12 +32,12 @@ class Auto_Load_Next_Post_Admin_Settings { * @return $settings */ public static function get_settings_pages() { - if ( empty( self::$settings ) ) { + if(empty( self::$settings)){ $settings = array(); - include_once( 'settings/class-auto-load-next-post-settings-page.php' ); - $settings[] = include( 'settings/class-auto-load-next-post-settings-general.php' ); - $settings[] = include( 'settings/class-auto-load-next-post-settings-support.php' ); + include_once('settings/class-auto-load-next-post-settings-page.php'); + $settings[] = include('settings/class-auto-load-next-post-settings-general.php'); + $settings[] = include('settings/class-auto-load-next-post-settings-support.php'); } return self::$settings; @@ -54,18 +54,18 @@ public static function get_settings_pages() { public static function save() { global $current_section, $current_tab; - if ( empty( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'auto-load-next-post-settings' ) ) { - wp_die( __( 'Action failed. Please refresh the page and retry.', 'auto-load-next-post' ) ); + if(empty( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'auto-load-next-post-settings')){ + wp_die( __('Action failed. Please refresh the page and retry.', 'auto-load-next-post') ); } // Trigger actions do_action( 'auto_load_next_post_settings_save_'.$current_tab ); do_action( 'auto_load_next_post_update_options_'.$current_tab ); - do_action( 'auto_load_next_post_update_options' ); + do_action( 'auto_load_next_post_update_options'); - self::add_message( __( 'Your settings have been saved.', 'auto-load-next-post' ) ); + self::add_message( __('Your settings have been saved.', 'auto-load-next-post') ); - do_action( 'auto_load_next_post_settings_saved' ); + do_action( 'auto_load_next_post_settings_saved'); } // END save() /** @@ -98,12 +98,12 @@ public static function add_error( $text ) { * @return string */ public static function show_messages() { - if ( sizeof( self::$errors ) > 0 ) { + if(sizeof( self::$errors ) > 0 ) { foreach ( self::$errors as $error ) { echo '

    '.esc_html( $error ).'

    '; } } - elseif ( sizeof( self::$messages ) > 0 ) { + elseif(sizeof( self::$messages ) > 0 ) { foreach ( self::$messages as $message ) { echo '

    '.esc_html( $message ).'

    '; } @@ -132,23 +132,23 @@ public static function output() { wp_enqueue_script( 'auto_load_next_post_settings', AUTO_LOAD_NEXT_POST_URL_PATH.'/assets/js/admin/settings'.AUTO_LOAD_NEXT_POST_SCRIPT_MODE.'.js', array( 'jquery' ), AUTO_LOAD_NEXT_POST_VERSION, true ); wp_localize_script( 'auto_load_next_post_settings', 'auto_load_next_post_settings_params', array( - 'i18n_nav_warning' => __( 'The changes you made will be lost if you navigate away from this page.', 'auto-load-next-post' ), + 'i18n_nav_warning' => __('The changes you made will be lost if you navigate away from this page.', 'auto-load-next-post'), ) ); // Include settings pages self::get_settings_pages(); // Save settings if data has been posted - if ( ! empty( $_POST ) ) { + if(! empty( $_POST)){ self::save(); } // Add any posted messages - if ( ! empty( $_GET['auto_load_next_post_error'] ) ) { + if(! empty( $_GET['auto_load_next_post_error'])){ self::add_error( urldecode( stripslashes( $_GET['auto_load_next_post_error'] ) ) ); } - if ( ! empty( $_GET['auto_load_next_post_message'] ) ) { + if(! empty( $_GET['auto_load_next_post_message'])){ self::add_message( urldecode( stripslashes( $_GET['auto_load_next_post_message'] ) ) ); } @@ -157,7 +157,7 @@ public static function output() { // Get tabs for the settings page $tabs = apply_filters( 'auto_load_next_post_settings_tabs_array', array() ); - include( 'views/html-admin-settings.php' ); + include('views/html-admin-settings.php'); } // END output() /** @@ -170,18 +170,18 @@ public static function output() { */ public static function get_option( $option_name, $default = '' ) { // Array value - if ( strstr( $option_name, '[' ) ) { + if(strstr( $option_name, '[')){ parse_str( $option_name, $option_array ); // Option name is first key $option_name = current( array_keys( $option_array ) ); // Get value - $option_values = get_option( $option_name, '' ); + $option_values = get_option( $option_name, ''); $key = key( $option_array[ $option_name ] ); - if ( isset( $option_values[ $key ] ) ) { + if(isset( $option_values[ $key ])){ $option_value = $option_values[ $key ]; } else { @@ -192,10 +192,10 @@ public static function get_option( $option_name, $default = '' ) { $option_value = get_option( $option_name, null ); } - if ( is_array( $option_value ) ) { + if(is_array( $option_value)){ $option_value = array_map( 'stripslashes', $option_value ); } - elseif ( ! is_null( $option_value ) ) { + elseif(! is_null( $option_value)){ $option_value = stripslashes( $option_value ); } @@ -213,34 +213,34 @@ public static function get_option( $option_name, $default = '' ) { */ public static function output_fields( $options ) { foreach ( $options as $value ) { - if ( ! isset( $value['type'] ) ) continue; - if ( ! isset( $value['id'] ) ) $value['id'] = ''; - if ( ! isset( $value['title'] ) ) $value['title'] = isset( $value['name'] ) ? $value['name'] : ''; - if ( ! isset( $value['class'] ) ) $value['class'] = ''; - if ( ! isset( $value['css'] ) ) $value['css'] = ''; - if ( ! isset( $value['default'] ) ) $value['default'] = ''; - if ( ! isset( $value['desc'] ) ) $value['desc'] = ''; - if ( ! isset( $value['desc_tip'] ) ) $value['desc_tip'] = false; + if(! isset( $value['type'] ) ) continue; + if(! isset( $value['id'] ) ) $value['id'] = ''; + if(! isset( $value['title'] ) ) $value['title'] = isset( $value['name'] ) ? $value['name'] : ''; + if(! isset( $value['class'] ) ) $value['class'] = ''; + if(! isset( $value['css'] ) ) $value['css'] = ''; + if(! isset( $value['default'] ) ) $value['default'] = ''; + if(! isset( $value['desc'] ) ) $value['desc'] = ''; + if(! isset( $value['desc_tip'] ) ) $value['desc_tip'] = false; // Custom attribute handling $custom_attributes = array(); - if ( ! empty( $value['custom_attributes'] ) && is_array( $value['custom_attributes'] ) ) { + if(! empty( $value['custom_attributes'] ) && is_array( $value['custom_attributes'])){ foreach ( $value['custom_attributes'] as $attribute => $attribute_value ) { $custom_attributes[] = esc_attr( $attribute ).'="'.esc_attr( $attribute_value ).'"'; } } // Description handling - if ( $value['desc_tip'] === true ) { + if($value['desc_tip'] === true ) { $description = ''; $tip = $value['desc']; } - else if ( ! empty( $value['desc_tip'] ) ) { + else if(! empty( $value['desc_tip'])){ $description = $value['desc']; $tip = $value['desc_tip']; } - else if ( ! empty( $value['desc'] ) ) { + else if(! empty( $value['desc'])){ $description = $value['desc']; $tip = ''; } @@ -248,17 +248,17 @@ public static function output_fields( $options ) { $description = $tip = ''; } - if ( $description && in_array( $value['type'], array( 'textarea', 'radio' ) ) ) { + if($description && in_array( $value['type'], array( 'textarea', 'radio' ))){ $description = '

    '.wp_kses_post( $description ).'

    '; } - else if ( $description ) { + else if($description ) { $description = ''.wp_kses_post( $description ).''; } - if ( $tip && in_array( $value['type'], array( 'checkbox' ) ) ) { + if($tip && in_array( $value['type'], array( 'checkbox' ))){ $tip = '

    '.$tip.'

    '; } - else if ( $tip ) { + else if($tip ) { $tip = ''; } @@ -266,17 +266,17 @@ public static function output_fields( $options ) { switch( $value['type'] ) { // Section Titles case 'title': - if ( ! empty( $value['title'] ) ) { + if(! empty( $value['title'])){ echo '

    '.esc_html( $value['title'] ).'

    '; } - if ( ! empty( $value['desc'] ) ) { + if(! empty( $value['desc'])){ echo wpautop( wptexturize( wp_kses_post( $value['desc'] ) ) ); } echo ''. "\n\n"; - if ( ! empty( $value['id'] ) ) { + if(! empty( $value['id'])){ do_action( 'auto_load_next_post_settings_'.sanitize_title( $value['id'] ) ); } @@ -285,14 +285,14 @@ public static function output_fields( $options ) { // Section Ends case 'sectionend': - if ( ! empty( $value['id'] ) ) { - do_action( 'auto_load_next_post_settings_'.sanitize_title( $value['id'] ).'_end' ); + if(! empty( $value['id'])){ + do_action( 'auto_load_next_post_settings_'.sanitize_title( $value['id'] ).'_end'); } echo '
    '; - if ( ! empty( $value['id'] ) ) { - do_action( 'auto_load_next_post_settings_'.sanitize_title( $value['id'] ).'_after' ); + if(! empty( $value['id'])){ + do_action( 'auto_load_next_post_settings_'.sanitize_title( $value['id'] ).'_after'); } break; @@ -307,7 +307,7 @@ public static function output_fields( $options ) { $class = ''; $option_value = self::get_option( $value['id'], $value['default'] ); - if ( $value['type'] == 'color' ) { + if($value['type'] == 'color' ) { $type = 'text'; $value['class'] .= 'colorpick'; $description .= ''; @@ -365,15 +365,15 @@ class="" × px - + " 'echo' => false, 'selected' => absint( self::get_option( $value['id'] ) ) ); - if ( isset( $value['args'] ) ) + if(isset( $value['args'] ) ) $args = wp_parse_args( $value['args'], $args ); ?> - + " * @return bool */ public static function save_fields( $options, $current_tab, $current_section = '' ) { - if ( empty( $_POST ) ) + if(empty( $_POST ) ) return false; // Options to update will be stored here @@ -542,7 +542,7 @@ public static function save_fields( $options, $current_tab, $current_section = ' // Loop options and get values to save foreach ( $options as $value ) { - if ( ! isset( $value['id'] ) ) + if(! isset( $value['id'] ) ) continue; $type = isset( $value['type'] ) ? sanitize_title( $value['type'] ) : ''; @@ -553,7 +553,7 @@ public static function save_fields( $options, $current_tab, $current_section = ' switch ( $type ) { // Standard types case "checkbox" : - if ( isset( $_POST[ $value['id'] ] ) ) { + if(isset( $_POST[ $value['id'] ])){ $option_value = 'yes'; } else { @@ -563,7 +563,7 @@ public static function save_fields( $options, $current_tab, $current_section = ' break; case "textarea" : - if ( isset( $_POST[$value['id']] ) ) { + if(isset( $_POST[$value['id']])){ $option_value = wp_kses_post( trim( stripslashes( $_POST[ $value['id'] ] ) ) ); } else { @@ -580,7 +580,7 @@ public static function save_fields( $options, $current_tab, $current_section = ' case "password" : case "single_select_page" : case "radio" : - if ( isset( $_POST[$value['id']] ) ) { + if(isset( $_POST[$value['id']])){ $option_value = auto_load_next_post_clean( stripslashes( $_POST[ $value['id'] ] ) ); } else { @@ -592,7 +592,7 @@ public static function save_fields( $options, $current_tab, $current_section = ' // Special types case "multiselect" : // Get array - if ( isset( $_POST[ $value['id'] ] ) ) { + if(isset( $_POST[ $value['id'] ])){ $selected_values = array_map( 'auto_load_next_post_clean', array_map( 'stripslashes', (array) $_POST[ $value['id'] ] ) ); } else { @@ -603,10 +603,10 @@ public static function save_fields( $options, $current_tab, $current_section = ' break; case "image_width" : - if ( isset( $_POST[$value['id'] ]['width'] ) ) { + if(isset( $_POST[$value['id'] ]['width'])){ $update_options[ $value['id'] ]['width'] = auto_load_next_post_clean( stripslashes( $_POST[ $value['id'] ]['width'] ) ); $update_options[ $value['id'] ]['height'] = auto_load_next_post_clean( stripslashes( $_POST[ $value['id'] ]['height'] ) ); - if ( isset( $_POST[ $value['id'] ]['crop'] ) ) { + if(isset( $_POST[ $value['id'] ]['crop'])){ $update_options[ $value['id'] ]['crop'] = 1; } else { @@ -629,21 +629,21 @@ public static function save_fields( $options, $current_tab, $current_section = ' } // END switch() - if ( ! is_null( $option_value ) ) { + if(! is_null( $option_value)){ // Check if option is an array - if ( strstr( $value['id'], '[' ) ) { + if(strstr( $value['id'], '[')){ parse_str( $value['id'], $option_array ); // Option name is first key $option_name = current( array_keys( $option_array ) ); // Get old option value - if ( ! isset( $update_options[ $option_name ] ) ) { + if(! isset( $update_options[ $option_name ])){ $update_options[ $option_name ] = get_option( $option_name, array() ); } - if ( ! is_array( $update_options[ $option_name ] ) ) { + if(! is_array( $update_options[ $option_name ])){ $update_options[ $option_name ] = array(); } @@ -669,7 +669,7 @@ public static function save_fields( $options, $current_tab, $current_section = ' } // Save all options as an array. Ready for export. - if ( empty( $current_section ) ) { + if(empty( $current_section)){ update_option( 'auto_load_next_post_options_'.$current_tab, $update_options ); } else { diff --git a/includes/admin/class-auto-load-next-post-admin.php b/includes/admin/class-auto-load-next-post-admin.php index abaf1e3..658f1e2 100644 --- a/includes/admin/class-auto-load-next-post-admin.php +++ b/includes/admin/class-auto-load-next-post-admin.php @@ -9,9 +9,9 @@ * @license GPL-2.0+ */ -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly +if(! defined('ABSPATH')) exit; // Exit if accessed directly -if ( ! class_exists( 'Auto_Load_Next_Post_Admin' ) ) { +if(! class_exists('Auto_Load_Next_Post_Admin')){ /** * Class - Auto_Load_Next_Post_Admin @@ -28,14 +28,14 @@ class Auto_Load_Next_Post_Admin { */ public function __construct() { // Actions - add_action( 'init', array( $this, 'includes' ), 10 ); - add_action( 'admin_init', array( $this, 'admin_scripts' ), 100 ); + add_action('init', array($this, 'includes' ), 10 ); + add_action('admin_init', array($this, 'admin_scripts' ), 100 ); // Filters - add_filter( 'plugin_action_links_'.plugin_basename( AUTO_LOAD_NEXT_POST_FILE ), array( $this, 'action_links' ) ); - add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 2 ); - add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ) ); - add_filter( 'update_footer', array( $this, 'update_footer' ), 15 ); + add_filter('plugin_action_links_'.plugin_basename( AUTO_LOAD_NEXT_POST_FILE ), array($this, 'action_links' ) ); + add_filter('plugin_row_meta', array($this, 'plugin_row_meta' ), 10, 2 ); + add_filter('admin_footer_text', array($this, 'admin_footer_text' ) ); + add_filter('update_footer', array($this, 'update_footer' ), 15 ); } // END __construct() /** @@ -47,11 +47,11 @@ public function __construct() { * @return void */ public function action_links( $links ) { - if ( current_user_can( 'manage_options' ) ) { + if(current_user_can( 'manage_options')){ $plugin_links = array( - ''.__( 'Upgrade to Premium', 'auto-load-next-post' ).'', - ''.__( 'Settings', 'auto-load-next-post' ).'', - ''.__( 'Support', 'auto-load-next-post' ).'', + ''.__('Upgrade to Premium', 'auto-load-next-post').'', + ''.__('Settings', 'auto-load-next-post').'', + ''.__('Support', 'auto-load-next-post').'', ); return array_merge( $plugin_links, $links ); @@ -70,13 +70,13 @@ public function action_links( $links ) { * @return array $input */ public function plugin_row_meta( $input, $file ) { - if ( plugin_basename( AUTO_LOAD_NEXT_POST_FILE ) !== $file ) { + if(plugin_basename( AUTO_LOAD_NEXT_POST_FILE ) !== $file ) { return $input; } $links = array( - ''.__( 'Documentation', 'auto-load-next-post' ).'', - ''.__( 'Community Support', 'auto-load-next-post' ).'' + ''.__('Documentation', 'auto-load-next-post').'', + ''.__('Community Support', 'auto-load-next-post').'' ); $input = array_merge( $input, $links ); @@ -92,14 +92,14 @@ public function plugin_row_meta( $input, $file ) { */ public function includes() { // The plugin checks requirements on activation before it does other stuff. - include_once( 'class-auto-load-next-post-admin-activation.php' ); + include_once('class-auto-load-next-post-admin-activation.php'); // Classes we only need if the ajax is not-ajax - if ( !auto_load_next_post_is_ajax() ) { - include( 'class-auto-load-next-post-install.php' ); // Install Plugin - include( 'class-auto-load-next-post-admin-menus.php' ); // Plugin Menu - include( 'class-auto-load-next-post-admin-notices.php' ); // Plugin Notices - include( 'class-auto-load-next-post-admin-help.php' ); // Plugin Help Tab + if(!auto_load_next_post_is_ajax() ) { + include('class-auto-load-next-post-install.php'); // Install Plugin + include('class-auto-load-next-post-admin-menus.php'); // Plugin Menu + include('class-auto-load-next-post-admin-notices.php'); // Plugin Notices + include('class-auto-load-next-post-admin-help.php'); // Plugin Help Tab } } // END includes() @@ -119,14 +119,12 @@ public function admin_scripts() { Auto_Load_Next_Post::load_file( 'jquery-tiptip', '/assets/js/libs/jquery-tiptip/jquery.tipTip'.AUTO_LOAD_NEXT_POST_SCRIPT_MODE.'.js', true, array('jquery'), AUTO_LOAD_NEXT_POST_VERSION ); // Variables for Admin JavaScripts wp_localize_script( AUTO_LOAD_NEXT_POST_SLUG.'_admin_script', 'auto_load_next_post_admin_params', array( - //'plugin_url' => Auto_Load_Next_Post::plugin_url(), - 'i18n_nav_warning' => __( 'The changes you made will be lost if you navigate away from this page.', 'auto-load-next-post' ), - //'plugin_screen_id' => AUTO_LOAD_NEXT_POST_SCREEN_ID, + 'i18n_nav_warning' => __('The changes you made will be lost if you navigate away from this page.', 'auto-load-next-post'), ) ); // Stylesheets - Auto_Load_Next_Post::load_file( AUTO_LOAD_NEXT_POST_SLUG.'_admin_style', '/assets/css/admin/auto-load-next-post'.AUTO_LOAD_NEXT_POST_SCRIPT_MODE.'.css' ); - Auto_Load_Next_Post::load_file( AUTO_LOAD_NEXT_POST_SLUG.'_chosen_style', '/assets/css/libs/chosen'.AUTO_LOAD_NEXT_POST_SCRIPT_MODE.'.css' ); + Auto_Load_Next_Post::load_file( AUTO_LOAD_NEXT_POST_SLUG.'_admin_style', '/assets/css/admin/auto-load-next-post'.AUTO_LOAD_NEXT_POST_SCRIPT_MODE.'.css'); + Auto_Load_Next_Post::load_file( AUTO_LOAD_NEXT_POST_SLUG.'_chosen_style', '/assets/css/libs/chosen'.AUTO_LOAD_NEXT_POST_SCRIPT_MODE.'.css'); } // END admin_scripts() /** @@ -142,11 +140,11 @@ public function admin_scripts() { public function admin_footer_text( $text ) { $screen = get_current_screen(); - if ( $screen->id == 'settings_page_auto-load-next-post-settings' ) { + if($screen->id == 'settings_page_auto-load-next-post-settings' ) { $links = array( - 'http://autoloadnextpost.com/?utm_source=wpadmin&utm_campaign=plugin-settings-footer' => __( 'Website', 'auto-load-next-post' ), - 'https://github.com/seb86/Auto-Load-Next-Post/wiki/?utm_source=wpadmin&utm_campaign=plugin-settings-footer' => __( 'Documentation', 'auto-load-next-post' ), + 'http://autoloadnextpost.com/?utm_source=wpadmin&utm_campaign=plugin-settings-footer' => __('Website', 'auto-load-next-post'), + 'https://github.com/seb86/Auto-Load-Next-Post/wiki/?utm_source=wpadmin&utm_campaign=plugin-settings-footer' => __('Documentation', 'auto-load-next-post'), ); $text = ''; @@ -162,7 +160,7 @@ public function admin_footer_text( $text ) { } // Rating and Review - $text .= sprintf( __( 'If you like %1$s please leave a ★★★★★ rating on WordPress.org. A huge thank you in advance!', 'auto-load-next-post' ), 'Auto Load Next Post', 'https://wordpress.org/support/view/plugin-reviews/auto-load-next-post?filter=5#postform' ); + $text .= sprintf( __('If you like %1$s please leave a ★★★★★ rating on WordPress.org. A huge thank you in advance!', 'auto-load-next-post'), 'Auto Load Next Post', 'https://wordpress.org/support/view/plugin-reviews/auto-load-next-post?filter=5#postform'); return $text; } @@ -184,13 +182,13 @@ public function admin_footer_text( $text ) { public function update_footer( $text ) { $screen = get_current_screen(); - if ( $screen->id == 'settings_page_auto-load-next-post-settings' ) { + if($screen->id == 'settings_page_auto-load-next-post-settings' ) { $text = ''; $links = array( - 'https://github.com/seb86/Auto-Load-Next-Post/blob/master/CONTRIBUTING.md?utm_source=wpadmin&utm_campaign=plugin-settings-footer' => __( 'Contribute', 'auto-load-next-post' ), - 'https://github.com/seb86/Auto-Load-Next-Post/issues?state=open&utm_source=wpadmin&utm_campaign=plugin-settings-footer' => __( 'Report Bugs', 'auto-load-next-post' ), + 'https://github.com/seb86/Auto-Load-Next-Post/blob/master/CONTRIBUTING.md?utm_source=wpadmin&utm_campaign=plugin-settings-footer' => __('Contribute', 'auto-load-next-post'), + 'https://github.com/seb86/Auto-Load-Next-Post/issues?state=open&utm_source=wpadmin&utm_campaign=plugin-settings-footer' => __('Report Bugs', 'auto-load-next-post'), ); foreach( $links as $key => $value ) { @@ -199,7 +197,7 @@ public function update_footer( $text ) { $text .= ''.'

    '. '

    '. - sprintf( __( '%s Version', 'auto-load-next-post' ), 'Auto Load Next Post' ). + sprintf( __('%s Version', 'auto-load-next-post'), 'Auto Load Next Post' ). ' : '.esc_attr( AUTO_LOAD_NEXT_POST_VERSION ).'

    '; return $text; diff --git a/includes/admin/class-auto-load-next-post-install.php b/includes/admin/class-auto-load-next-post-install.php index 4250b53..59c6d11 100644 --- a/includes/admin/class-auto-load-next-post-install.php +++ b/includes/admin/class-auto-load-next-post-install.php @@ -9,9 +9,9 @@ * @license GPL-2.0+ */ -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly +if(! defined('ABSPATH')) exit; // Exit if accessed directly -if ( ! class_exists( 'Auto_Load_Next_Post_Install' ) ) { +if(! class_exists('Auto_Load_Next_Post_Install')){ /** * Class - Auto_Load_Next_Post_Install @@ -27,7 +27,7 @@ class Auto_Load_Next_Post_Install { * @access public */ public function __construct() { - register_deactivation_hook( AUTO_LOAD_NEXT_POST_FILE, array( $this, 'deactivate' ) ); + register_deactivation_hook( AUTO_LOAD_NEXT_POST_FILE, array($this, 'deactivate' ) ); } // END __construct() /** @@ -63,13 +63,13 @@ public function deactivate() { */ public function create_options() { // Include settings so that we can run through defaults - include_once( 'class-auto-load-next-post-admin-settings.php' ); + include_once('class-auto-load-next-post-admin-settings.php'); $settings = Auto_Load_Next_Post_Admin_Settings::get_settings_pages(); foreach ( $settings as $section ) { foreach ( $section->get_settings() as $value ) { - if ( isset( $value['default'] ) && isset( $value['id'] ) ) { + if(isset( $value['default'] ) && isset( $value['id'])){ $autoload = isset( $value['autoload'] ) ? (bool) $value['autoload'] : true; add_option( $value['id'], $value['default'], '', ( $autoload ? 'yes' : 'no' ) ); } diff --git a/includes/admin/settings/class-auto-load-next-post-settings-general.php b/includes/admin/settings/class-auto-load-next-post-settings-general.php index 12036d0..adb727c 100644 --- a/includes/admin/settings/class-auto-load-next-post-settings-general.php +++ b/includes/admin/settings/class-auto-load-next-post-settings-general.php @@ -8,9 +8,9 @@ * @package Auto Load Next Post * @license GPL-2.0+ */ -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly +if(! defined('ABSPATH')) exit; // Exit if accessed directly -if ( ! class_exists( 'Auto_Load_Next_Post_Settings_General_Tab' ) ) { +if(! class_exists('Auto_Load_Next_Post_Settings_General_Tab')){ /** * Class - Auto_Load_Next_Post_Settings_General_Tab @@ -28,12 +28,12 @@ class Auto_Load_Next_Post_Settings_General_Tab extends Auto_Load_Next_Post_Setti */ public function __construct() { $this->id = 'general'; - $this->label = __( 'General', 'auto-load-next-post' ); + $this->label = __('General', 'auto-load-next-post'); - add_filter( 'auto_load_next_post_settings_submenu_array', array( $this, 'add_menu_page' ), 20 ); - add_filter( 'auto_load_next_post_settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); - add_action( 'auto_load_next_post_settings_'.$this->id, array( $this, 'output' ) ); - add_action( 'auto_load_next_post_settings_save_'.$this->id, array( $this, 'save' ) ); + add_filter('auto_load_next_post_settings_submenu_array', array($this, 'add_menu_page' ), 20 ); + add_filter('auto_load_next_post_settings_tabs_array', array($this, 'add_settings_page' ), 20 ); + add_action('auto_load_next_post_settings_'.$this->id, array($this, 'output' ) ); + add_action('auto_load_next_post_settings_save_'.$this->id, array($this, 'save' ) ); } // END __construct() /** @@ -61,7 +61,7 @@ public function save() { * @return array */ public function get_post_types() { - $post_types = get_post_types( array( 'public' => true ), 'names' ); + $post_types = get_post_types( array( 'public' => true ), 'names'); return $post_types; } // END get_post_types() @@ -77,15 +77,15 @@ public function get_settings() { return apply_filters( 'auto_load_next_post_'.$this->id.'_settings', array( array( - 'title' => __( 'Information', 'auto-load-next-post' ), + 'title' => __('Information', 'auto-load-next-post'), 'type' => 'title', - 'desc' => __( 'For the plugin to work you need to set the variables below.', 'auto-load-next-post' ), + 'desc' => __('For the plugin to work you need to set the variables below.', 'auto-load-next-post'), 'id' => $this->id.'_options' ), array( - 'title' => __( 'Restrict Post Types', 'auto-load-next-post' ), - 'desc' => __( 'Select which post types you wish to load automatically.', 'auto-load-next-post' ), + 'title' => __('Restrict Post Types', 'auto-load-next-post'), + 'desc' => __('Select which post types you wish to load automatically.', 'auto-load-next-post'), 'desc_tip' => true, 'id' => 'auto_load_next_post_get_post_types', 'class' => 'chosen-select', @@ -97,8 +97,8 @@ public function get_settings() { ), array( - 'title' => __( 'Content Container', 'auto-load-next-post' ), - 'desc' => __( 'Example: main.site-main', 'auto-load-next-post' ), + 'title' => __('Content Container', 'auto-load-next-post'), + 'desc' => __('Example: main.site-main', 'auto-load-next-post'), 'desc_tip' => true, 'id' => 'auto_load_next_post_content_container', 'default' => 'main.site-main', @@ -108,8 +108,8 @@ public function get_settings() { ), array( - 'title' => __( 'Post Title Selector', 'auto-load-next-post' ), - 'desc' => __( 'Example: h1.entry-title', 'auto-load-next-post' ), + 'title' => __('Post Title Selector', 'auto-load-next-post'), + 'desc' => __('Example: h1.entry-title', 'auto-load-next-post'), 'desc_tip' => true, 'id' => 'auto_load_next_post_title_selector', 'default' => 'h1.entry-title', @@ -119,8 +119,8 @@ public function get_settings() { ), array( - 'title' => __( 'Post Navigation Container', 'auto-load-next-post' ), - 'desc' => __( 'Example: nav.post-navigation', 'auto-load-next-post' ), + 'title' => __('Post Navigation Container', 'auto-load-next-post'), + 'desc' => __('Example: nav.post-navigation', 'auto-load-next-post'), 'desc_tip' => true, 'id' => 'auto_load_next_post_navigation_container', 'default' => 'nav.post-navigation', @@ -130,8 +130,8 @@ public function get_settings() { ), array( - 'title' => __( 'Comments Container', 'auto-load-next-post' ), - 'desc' => __( 'Example: div#comments', 'auto-load-next-post' ), + 'title' => __('Comments Container', 'auto-load-next-post'), + 'desc' => __('Example: div#comments', 'auto-load-next-post'), 'desc_tip' => true, 'id' => 'auto_load_next_post_comments_container', 'default' => 'div#comments', @@ -141,32 +141,32 @@ public function get_settings() { ), array( - 'title' => __( 'Remove Comments', 'auto-load-next-post' ), - 'desc' => __( 'Enable to remove comments when each post loads.', 'auto-load-next-post' ), + 'title' => __('Remove Comments', 'auto-load-next-post'), + 'desc' => __('Enable to remove comments when each post loads.', 'auto-load-next-post'), 'id' => 'auto_load_next_post_remove_comments', 'default' => 'yes', 'type' => 'checkbox' ), array( - 'title' => __( 'Update Google Analytics', 'auto-load-next-post' ), - 'desc' => __( 'Each time a post is loaded it will count as a pageview. You must have a reference to your Google Analytics tracking code on the page.', 'auto-load-next-post' ), + 'title' => __('Update Google Analytics', 'auto-load-next-post'), + 'desc' => __('Each time a post is loaded it will count as a pageview. You must have a reference to your Google Analytics tracking code on the page.', 'auto-load-next-post'), 'id' => 'auto_load_next_post_google_analytics', 'default' => 'no', 'type' => 'checkbox' ), array( - 'title' => __( 'Reset all data?', 'auto-load-next-post' ), - 'desc' => __( 'Press the reset button to clear all settings for this plugin and re-install the default settings.', 'auto-load-next-post' ), + 'title' => __('Reset all data?', 'auto-load-next-post'), + 'desc' => __('Press the reset button to clear all settings for this plugin and re-install the default settings.', 'auto-load-next-post'), 'id' => 'auto_load_next_post_uninstall_data', 'default' => 'no', 'type' => 'reset_data' ), array( - 'title' => __( 'Remove all data on uninstall?', 'auto-load-next-post' ), - 'desc' => __( 'If enabled, all settings for this plugin will all be deleted when uninstalling via Plugins > Delete.', 'auto-load-next-post' ), + 'title' => __('Remove all data on uninstall?', 'auto-load-next-post'), + 'desc' => __('If enabled, all settings for this plugin will all be deleted when uninstalling via Plugins > Delete.', 'auto-load-next-post'), 'id' => 'auto_load_next_post_uninstall_data', 'default' => 'no', 'type' => 'checkbox' diff --git a/includes/admin/settings/class-auto-load-next-post-settings-page.php b/includes/admin/settings/class-auto-load-next-post-settings-page.php index c52a338..71f5379 100644 --- a/includes/admin/settings/class-auto-load-next-post-settings-page.php +++ b/includes/admin/settings/class-auto-load-next-post-settings-page.php @@ -9,9 +9,9 @@ * @license GPL-2.0+ */ -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly +if(! defined('ABSPATH')) exit; // Exit if accessed directly -if ( ! class_exists( 'Auto_Load_Next_Post_Settings_Page' ) ) { +if(! class_exists('Auto_Load_Next_Post_Settings_Page')){ /** * Class - Auto_Load_Next_Post_Settings_Page @@ -83,7 +83,7 @@ public function output_sections() { $sections = $this->get_sections(); - if ( empty( $sections ) ) + if(empty( $sections ) ) return; $output = '
      '; @@ -95,7 +95,7 @@ public function output_sections() { $section_link = admin_url( 'options-general.php?page=auto-load-next-post-settings&tab='.$this->id.'§ion='.sanitize_title( $id ) ); // If this section is default then remove the variable from this link. - if ( $id == '' ) { + if($id == '' ) { $section_link = remove_query_arg( 'section', $section_link ); } @@ -136,7 +136,7 @@ public function save() { Auto_Load_Next_Post_Admin_Settings::save_fields( $settings, $current_tab, $current_section ); - if ( $current_section ) { + if($current_section ) { do_action( 'auto_load_next_post_update_options_'.$this->id.'_'.$current_section ); } diff --git a/includes/admin/settings/class-auto-load-next-post-settings-support.php b/includes/admin/settings/class-auto-load-next-post-settings-support.php index 6087dd2..c51cdfc 100644 --- a/includes/admin/settings/class-auto-load-next-post-settings-support.php +++ b/includes/admin/settings/class-auto-load-next-post-settings-support.php @@ -9,9 +9,9 @@ * @license GPL-2.0+ */ -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly +if(! defined('ABSPATH')) exit; // Exit if accessed directly -if ( ! class_exists( 'Auto_Load_Next_Post_Settings_Support_Tab' ) ) { +if(! class_exists('Auto_Load_Next_Post_Settings_Support_Tab')){ /** * Auto_Load_Next_Post_Settings_Support_Tab @@ -26,11 +26,11 @@ class Auto_Load_Next_Post_Settings_Support_Tab extends Auto_Load_Next_Post_Setti */ public function __construct() { $this->id = 'support'; - $this->label = __( 'Support', 'auto-load-next-post' ); + $this->label = __('Support', 'auto-load-next-post'); - add_filter( 'auto_load_next_post_settings_submenu_array', array( $this, 'add_menu_page' ), 20 ); - add_filter( 'auto_load_next_post_settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); - add_action( 'auto_load_next_post_settings_'.$this->id, array( $this, 'output' ) ); + add_filter('auto_load_next_post_settings_submenu_array', array($this, 'add_menu_page'), 20); + add_filter('auto_load_next_post_settings_tabs_array', array($this, 'add_settings_page'), 20); + add_action('auto_load_next_post_settings_'.$this->id, array($this, 'output')); } // END __construct() /** @@ -42,7 +42,7 @@ public function __construct() { public function output() { $settings = $this->get_settings(); - Auto_Load_Next_Post_Admin_Settings::output_fields( $settings ); + Auto_Load_Next_Post_Admin_Settings::output_fields($settings); } // END output() /** @@ -53,11 +53,11 @@ public function output() { * @return string */ public function callback() { - return '

      '.__( 'As this is a free plugin, I can not provide support.', 'auto-load-next-post' ).'

      '. - '

      '.sprintf( __( 'You may ask the WordPress community for help by posting to the WordPress.org support forum. Response time can range from a few days to a few weeks and will likely be from a non-developer.', 'auto-load-next-post' ), 'https://wordpress.org/support/plugin/auto-load-next-post' ).'

      '. - '

      '.sprintf( __( 'If you want a timely response via email from me, upgrade and then send me an email.', 'auto-load-next-post' ), 'https://www.sebastiendumont.com/plugins/auto-load-next-post/?utm_source=insideplugin&utm_medium=web&utm_content=support-tab&utm_campaign=freeplugin-alnp' ).'

      '. - '

      '.sprintf( __( 'If you\'ve found a bug, please submit an issue on GitHub.', 'auto-load-next-post' ), 'https://github.com/seb86/Auto-Load-Next-Post/issues' ).'

      '. - '

      '.__( 'Thank you.', 'auto-load-next-post' ).'

      '; + return '

      '.__('As this is a free plugin, I can not provide support.', 'auto-load-next-post').'

      '. + '

      '.sprintf( __('You may ask the WordPress community for help by posting to the WordPress.org support forum. Response time can range from a few days to a few weeks and will likely be from a non-developer.', 'auto-load-next-post'), 'https://wordpress.org/support/plugin/auto-load-next-post' ).'

      '. + '

      '.sprintf( __('If you want a timely response via email from me, upgrade and then send me an email.', 'auto-load-next-post'), 'https://www.sebastiendumont.com/plugins/auto-load-next-post/?utm_source=insideplugin&utm_medium=web&utm_content=support-tab&utm_campaign=freeplugin-alnp' ).'

      '. + '

      '.sprintf( __('If you\'ve found a bug, please submit an issue on GitHub.', 'auto-load-next-post'), 'https://github.com/seb86/Auto-Load-Next-Post/issues' ).'

      '. + '

      '.__('Thank you.', 'auto-load-next-post').'

      '; } // END callback() /** @@ -72,7 +72,7 @@ public function get_settings() { return array( array( - 'title' => __( 'Support', 'auto-load-next-post' ), + 'title' => __('Support', 'auto-load-next-post'), 'type' => 'title', 'desc' => $this->callback(), 'id' => 'auto_load_next_post_support_tab' diff --git a/includes/admin/views/html-admin-settings.php b/includes/admin/views/html-admin-settings.php index aa87294..26ca753 100644 --- a/includes/admin/views/html-admin-settings.php +++ b/includes/admin/views/html-admin-settings.php @@ -2,7 +2,7 @@ /** * Admin View: Settings */ -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly. +if(! defined('ABSPATH')) exit; // Exit if accessed directly. ?>
      @@ -12,7 +12,7 @@ foreach ( $tabs as $name => $label ) { echo ''.$label.''; } - do_action( 'auto_load_next_post_settings_tabs' ); + do_action( 'auto_load_next_post_settings_tabs'); ?>

      - + - +

      diff --git a/includes/admin/views/html-notice-requirement-wp.php b/includes/admin/views/html-notice-requirement-wp.php index 2cb2e35..8e50ddf 100644 --- a/includes/admin/views/html-notice-requirement-wp.php +++ b/includes/admin/views/html-notice-requirement-wp.php @@ -3,7 +3,7 @@ * Admin View: Admin WordPress Requirment Notice */ -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly +if(! defined('ABSPATH')) exit; // Exit if accessed directly ?>

      %s requires WordPress %s or higher. Please upgrade your WordPress setup.', 'auto-load-next-post'), 'Auto Load Next Post', AUTO_LOAD_NEXT_POST_WP_VERSION_REQUIRE ); ?>

      diff --git a/includes/admin/views/html-notice-theme-support.php b/includes/admin/views/html-notice-theme-support.php index a00ea3a..10b62ac 100644 --- a/includes/admin/views/html-notice-theme-support.php +++ b/includes/admin/views/html-notice-theme-support.php @@ -3,9 +3,9 @@ * Admin View: Admin Theme Notice */ -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly +if(! defined('ABSPATH')) exit; // Exit if accessed directly ?>
      -

      The theme you are using has not declared support for %s – please read the integration guide.', 'Auto Load Next Post' ), 'auto-load-next-post' ); ?>

      -

      +

      The theme you are using has not declared support for %s – please read the integration guide.', 'Auto Load Next Post' ), 'auto-load-next-post'); ?>

      +

      diff --git a/includes/admin/wp-update-php/WPUpdatePhp.php b/includes/admin/wp-update-php/WPUpdatePhp.php index ad8c84a..bf1c624 100644 --- a/includes/admin/wp-update-php/WPUpdatePhp.php +++ b/includes/admin/wp-update-php/WPUpdatePhp.php @@ -16,7 +16,7 @@ public function __construct( $minimum_version ) { * @return bool */ public function does_it_meet_required_php_version( $version ) { - if ( $this->is_minimum_php_version( $version ) ) { + if($this->is_minimum_php_version( $version)){ return true; } @@ -30,21 +30,21 @@ public function does_it_meet_required_php_version( $version ) { * @return boolean */ private function is_minimum_php_version( $version ) { - return version_compare( $this->minimum_version, $version, '<=' ); + return version_compare( $this->minimum_version, $version, '<='); } /** * @return void */ private function load_minimum_required_version_notice() { - if ( is_admin() && ! defined( 'DOING_AJAX' ) ) { - add_action( 'admin_notices', array( $this, 'admin_notice' ) ); + if(is_admin() && ! defined( 'DOING_AJAX')){ + add_action('admin_notices', array($this, 'admin_notice' ) ); } } public function admin_notice() { echo '
      '; - echo '

      '.sprintf( __( 'Unfortunately, %s can not run on PHP versions older than '. $this->minimum_version .'. Read more information about how you can update'), 'Auto Load Next Post').'.

      '; + echo '

      '.sprintf( __('Unfortunately, %s can not run on PHP versions older than '. $this->minimum_version .'. Read more information about how you can update'), 'Auto Load Next Post').'.

      '; echo '
      '; } } diff --git a/includes/auto-load-next-post-conditional-functions.php b/includes/auto-load-next-post-conditional-functions.php index 1c18c78..3ce79f3 100644 --- a/includes/auto-load-next-post-conditional-functions.php +++ b/includes/auto-load-next-post-conditional-functions.php @@ -11,9 +11,9 @@ * @license GPL-2.0+ */ -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly +if(! defined('ABSPATH')) exit; // Exit if accessed directly -if ( ! function_exists( 'auto_load_next_post_is_ajax' ) ) { +if(! function_exists( 'auto_load_next_post_is_ajax')){ /** * Returns true when the page is loaded via ajax. * @@ -22,7 +22,7 @@ * @return bool */ function auto_load_next_post_is_ajax() { - if ( defined( 'DOING_AJAX' ) ) { + if(defined( 'DOING_AJAX')){ return true; } @@ -30,7 +30,7 @@ function auto_load_next_post_is_ajax() { } // END auto_load_next_post_is_ajax } -if ( ! function_exists( 'supports_alnp' ) ) { +if(! function_exists( 'supports_alnp')){ /** * Returns true or false if the plugin is supported by the theme. * @@ -44,9 +44,9 @@ function supports_alnp(){ 'twentyfifteen', 'twentyfourteen', 'twentythirteen', 'twentytwelve', 'twentyten' ); - if ( in_array( get_option('template'), $core_themes ) ) { + if(in_array( get_option('template'), $core_themes)){ return true; - } else if ( current_theme_supports('auto-load-next-post') ) { + } else if(current_theme_supports('auto-load-next-post') ) { return true; } diff --git a/includes/auto-load-next-post-core-functions.php b/includes/auto-load-next-post-core-functions.php index 0255a95..c16d0a7 100644 --- a/includes/auto-load-next-post-core-functions.php +++ b/includes/auto-load-next-post-core-functions.php @@ -11,11 +11,11 @@ * @license GPL-2.0+ */ -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly +if(! defined('ABSPATH')) exit; // Exit if accessed directly // Include core functions -include( 'auto-load-next-post-conditional-functions.php' ); -include( 'auto-load-next-post-formatting-functions.php' ); +include('auto-load-next-post-conditional-functions.php'); +include('auto-load-next-post-formatting-functions.php'); /** * When the 'partial' endpoint is used on a post, retrieve only the post content. @@ -24,7 +24,7 @@ function auto_load_next_post_template_redirect() { global $wp_query; // if this is not a request for partial or a singular object then bail - if ( ! isset( $wp_query->query_vars['partial'] ) || ! is_singular() ) + if(! isset($wp_query->query_vars['partial']) || ! is_singular()) return; /** @@ -34,12 +34,12 @@ function auto_load_next_post_template_redirect() { $template_path = get_stylesheet_directory().'/'.AUTO_LOAD_NEXT_POST_TEMPLATE_PATH; $default_path = AUTO_LOAD_NEXT_POST_FILE_PATH; - if ( file_exists ( $template_path.'content-partial.php' ) ) { - include ( $template_path.'content-partial.php' ); - } else if ( file_exists ( $default_path.'/template/content-partial.php' ) ) { - include ( $default_path.'/template/content-partial.php' ); + if(file_exists( $template_path.'content-partial.php')){ + include($template_path.'content-partial.php'); + }else if(file_exists( $default_path.'/template/content-partial.php')){ + include($default_path.'/template/content-partial.php'); } exit; } -add_action( 'template_redirect', 'auto_load_next_post_template_redirect' ); +add_action('template_redirect', 'auto_load_next_post_template_redirect'); diff --git a/includes/auto-load-next-post-formatting-functions.php b/includes/auto-load-next-post-formatting-functions.php index d891f38..b911c24 100644 --- a/includes/auto-load-next-post-formatting-functions.php +++ b/includes/auto-load-next-post-formatting-functions.php @@ -9,7 +9,7 @@ * @license GPL-2.0+ */ -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly +if(! defined('ABSPATH')) exit; // Exit if accessed directly /** * Clean variables diff --git a/readme.txt b/readme.txt index d191afe..80c26fb 100644 --- a/readme.txt +++ b/readme.txt @@ -119,7 +119,7 @@ A.6 Well, WordPress loads posts in descending order by default so the next post == Changelog == -= 1.4.3 : 20th October 2015 = += 1.4.3 : 19th October 2015 = * Corrected undefined function for Google Analytics tracking in the JavaScript. * Improved Google Analytics. Now detects old, classic, current and Yoast method of tracking pageviews. * Changed the default content container setting to match Twenty Fifteen. diff --git a/template/content-partial.php b/template/content-partial.php index bb4518a..779625b 100644 --- a/template/content-partial.php +++ b/template/content-partial.php @@ -6,31 +6,31 @@ */ // Fetch plugin settings. -$remove_comments = get_option( 'auto_load_next_post_remove_comments' ); +$remove_comments = get_option( 'auto_load_next_post_remove_comments'); // Load content before the loop. -do_action( 'alnp_load_before_loop' ); +do_action( 'alnp_load_before_loop'); // Check that there are more posts to load. while ( have_posts() ) : the_post(); $post_format = get_post_format(); // Post Format e.g. video - if ( false === $post_format ) { + if(false === $post_format ) { $post_format = 'standard'; } // Load content before the post content. - do_action( 'alnp_load_before_content' ); + do_action( 'alnp_load_before_content'); // Load content before the post content for a specific post format. do_action( 'alnp_load_before_content_type_'.$post_format ); - if ( $post_format == 'standard' ) { + if($post_format == 'standard' ) { // Include the content. - get_template_part( 'content' ); + get_template_part( 'content'); } else { // Include the post format content. - if ( locate_template( 'format-'.$post_format.'.php') != '' ) { + if(locate_template( 'format-'.$post_format.'.php') != '' ) { get_template_part( 'format', $post_format ); } else { // If no format-{post-format}.php file found then fallback to content-{post-format}.php @@ -39,21 +39,21 @@ } // If comments are open or we have at least one comment, load up the comment template. - if ( comments_open() || get_comments_number() ) : - if ( $remove_comments != 'yes' ) { comments_template(); } + if(comments_open() || get_comments_number() ) : + if($remove_comments != 'yes' ) { comments_template(); } endif; // Load content after the post content for a specific post format. do_action( 'alnp_load_after_content_type_'.$post_format ); // Load content after the post content. - do_action( 'alnp_load_after_content' ); + do_action( 'alnp_load_after_content'); ?> query("DELETE FROM $wpdb->options WHERE option_name LIKE 'auto_load_next_post_%';"); } From ab362da7eb101669403f012589e1c0b92a23750c Mon Sep 17 00:00:00 2001 From: Sebastien Dumont Date: Tue, 20 Oct 2015 01:15:12 +0200 Subject: [PATCH 3/5] Removed whitespace. --- uninstall.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/uninstall.php b/uninstall.php index 2e4b010..f2c58bf 100644 --- a/uninstall.php +++ b/uninstall.php @@ -8,15 +8,15 @@ * @package Auto Load Next Post * @license GPL-2.0+ */ -if( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) exit(); +if( ! defined('WP_UNINSTALL_PLUGIN')) exit(); global $wpdb; // For a single site -if(! is_multisite() ) { - $uninstall = get_option( 'auto_load_next_post_uninstall_data'); +if(! is_multisite()) { + $uninstall = get_option('auto_load_next_post_uninstall_data'); - if(! empty( $uninstall)){ + if(! empty($uninstall)) { // Delete options $wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE 'auto_load_next_post_%';"); } From e74370c12855138db1b9bc5d82eeecbb8a8fac26 Mon Sep 17 00:00:00 2001 From: Sebastien Dumont Date: Tue, 20 Oct 2015 02:09:27 +0200 Subject: [PATCH 4/5] Added back whitespace in development version of the JavaScript. --- assets/js/frontend/auto-load-next-post.js | 74 +++++++++++------------ 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/assets/js/frontend/auto-load-next-post.js b/assets/js/frontend/auto-load-next-post.js index 04f89c3..bad9ac4 100644 --- a/assets/js/frontend/auto-load-next-post.js +++ b/assets/js/frontend/auto-load-next-post.js @@ -11,20 +11,20 @@ jQuery.noConflict(); jQuery( document ).ready( function() { // Don't do this if looking for comments - if(window.location.href.indexOf( '#comments' ) > -1 ) { + if ( window.location.href.indexOf( '#comments' ) > -1 ) { return; } // It's up to you if you want to hide the comments. If the answer is yes then the comments will be gone. - if(remove_comments === 'yes' ) { + if ( remove_comments === 'yes' ) { jQuery( comments_container ).remove(); // Remove Comments - if(jQuery( comments_container ).length <= 0 ) { - console.log( 'Comments Removed'); + if ( jQuery( comments_container ).length <= 0 ) { + console.log( 'Comments Removed' ); } } // Add a divider - jQuery( content_container ).prepend( '
      '); + jQuery( content_container ).prepend( '
      ' ); // Initialise Scrollspy initialise_scrollspy(); @@ -43,17 +43,17 @@ function initialise_history() { function scrollspy() { // Spy on post-divider - changes the URL in browser location, loads new post - jQuery('.post-divider').on('scrollSpy:exit', changeURL ); - jQuery('.post-divider').on('scrollSpy:enter', changeURL ); - jQuery('.post-divider').scrollSpy(); + jQuery( '.post-divider').on( 'scrollSpy:exit', changeURL ); + jQuery( '.post-divider').on( 'scrollSpy:enter', changeURL ); + jQuery( '.post-divider').scrollSpy(); } // END scrollspy() function history(){ // Bind to StateChange Event - History.Adapter.bind(window,'statechange',function(){ // Note: We are using statechange instead of popstate + History.Adapter.bind( window,'statechange', function() { // Note: We are using statechange instead of popstate var State = History.getState(); // Note: We are using History.getState() instead of event.state - if(State.url != curr_url ) { + if ( State.url != curr_url ) { window.location.reload(State.url); } }); @@ -61,19 +61,19 @@ function history(){ function changeURL() { var el = jQuery(this); - var this_url = el.attr('data-url'); - var this_title = el.attr('data-title'); + var this_url = el.attr( 'data-url' ); + var this_title = el.attr( 'data-title' ); var offset = el.offset(); var scrollTop = jQuery(document).scrollTop(); // If exiting or entering from top, change URL - if(( offset.top - scrollTop ) < 150 && curr_url != this_url ) { + if ( ( offset.top - scrollTop ) < 150 && curr_url != this_url ) { curr_url = this_url; History.pushState(null, null, this_url); window.document.title = this_title; - if(track_pageviews == 'yes' ) { - console.log( 'Google Analytics Tracking Enabled'); + if ( track_pageviews == 'yes' ) { + console.log( 'Google Analytics Tracking Enabled' ); update_google_analytics(); } // END if track_pageviews } @@ -93,8 +93,8 @@ function changeURL() { * Also supports Google Analytics by Yoast should it be used. */ function update_google_analytics() { - if(typeof pageTracker === "undefined" || typeof _gaq === 'undefined' || typeof ga === 'undefined' || typeof __gaTracker === 'undefined' ) { - console.error( 'Google Analytics is not installed!'); + if ( typeof pageTracker === "undefined" || typeof _gaq === 'undefined' || typeof ga === 'undefined' || typeof __gaTracker === 'undefined' ) { + console.error( 'Google Analytics is not installed!' ); return; } @@ -102,27 +102,27 @@ function update_google_analytics() { console.log( 'Track: ' + track_page_url ); // This uses Asynchronous version of Google Analytics tracking method. - if(typeof pageTracker !== "undefined" && pageTracker !== null ) { - console.log( 'Google Analytics is installed, but old.'); + if ( typeof pageTracker !== "undefined" && pageTracker !== null ) { + console.log( 'Google Analytics is installed, but old.' ); pageTracker._trackPageview( track_page_url ); } // This uses Google's classic Google Analytics tracking method. - if(typeof _gaq !== 'undefined' && _gaq !== null ) { - console.log( 'Google Analytics is installed. Yahoo!'); + if ( typeof _gaq !== 'undefined' && _gaq !== null ) { + console.log( 'Google Analytics is installed. Yahoo!' ); _gaq.push(['_trackPageview', track_page_url]); } // This uses Google Analytics Universal Analytics tracking method. - if(typeof ga !== 'undefined' && _ga !== null ) { - console.log( 'Google Analytics Universal Analytics is installed. Yahoo!'); - ga('send', 'pageview', track_page_url); + if ( typeof ga !== 'undefined' && _ga !== null ) { + console.log( 'Google Analytics Universal Analytics is installed. Yahoo!' ); + ga( 'send', 'pageview', track_page_url); } // This uses Yoast's method of tracking Google Analytics. - if(typeof __gaTracker !== 'undefined' && __gaTracker !== null ) { - console.log( 'Google Analytics by Yoast is installed. Awesome!'); - __gaTracker('send', 'pageview', track_page_url); + if ( typeof __gaTracker !== 'undefined' && __gaTracker !== null ) { + console.log( 'Google Analytics by Yoast is installed. Awesome!' ); + __gaTracker( 'send', 'pageview', track_page_url); } } // END update_google_analytics() @@ -131,26 +131,26 @@ function update_google_analytics() { */ function auto_load_next_post() { // Grab the url for the next post - var post_url = jQuery('a[rel="prev"]').attr('href'); + var post_url = jQuery( 'a[rel="prev"]').attr( 'href' ); // For some browsers, `post_url` is undefined; for others, // `post_url` is false. So we check for both possibilites. - if(typeof post_url !== typeof undefined && post_url !== false ) { - console.log( 'Post URL was defined. All is good.'); + if ( typeof post_url !== typeof undefined && post_url !== false ) { + console.log( 'Post URL was defined. All is good.' ); console.log( 'Next Post URL: ' + post_url ); } else { - console.error( 'Post URL was not defined. Oh dear!'); + console.error( 'Post URL was not defined. Oh dear!' ); } - if(!post_url ) return; + if ( !post_url ) return; // Check to see if pretty permalinks, if not then add partial=1 - if(post_url.indexOf( '?p=' ) > -1 ) { + if ( post_url.indexOf( '?p=' ) > -1 ) { np_url = post_url + '&partial=1' } else { var partial_endpoint = 'partial/'; - if(post_url.charAt(post_url.length - 1) != '/' ) + if ( post_url.charAt(post_url.length - 1) != '/' ) partial_endpoint = '/' + partial_endpoint; np_url = post_url + partial_endpoint; @@ -158,8 +158,8 @@ function auto_load_next_post() { // Remove the post navigation HTML once the next post has loaded. jQuery( nav_container ).remove(); - if(jQuery( nav_container ).length <= 0 ) { - console.log( 'Post Navigation Removed!'); + if ( jQuery( nav_container ).length <= 0 ) { + console.log( 'Post Navigation Removed!' ); } jQuery.get( np_url , function( data ) { @@ -175,7 +175,7 @@ function auto_load_next_post() { jQuery( content_container ).append( post_html ); // Add next post // get the HR element and add the data-title - jQuery( 'hr[data-url="' + post_url + '"]').attr( 'data-title' , post_title.text() ).css( 'display', 'inline-block'); + jQuery( 'hr[data-url="' + post_url + '"]').attr( 'data-title' , post_title.text() ).css( 'display', 'inline-block' ); // need to set up ScrollSpy on new content scrollspy(); From 9884a079e448f2377600f1bfc4ccfd84cc6dc3cc Mon Sep 17 00:00:00 2001 From: Sebastien Dumont Date: Tue, 20 Oct 2015 02:24:14 +0200 Subject: [PATCH 5/5] Updated readme files and the changelog file. --- CHANGELOG.md | 23 +++++++++++++++++++ README.md | 63 +++++++++++++++++++++++++++++++++------------------- readme.txt | 7 +++--- 3 files changed, 67 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f9c837..07444b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,26 @@ +## 1.4.3 (20th October 2015) +* Corrected undefined function for Google Analytics tracking in the JavaScript. +* Improved Google Analytics. Now detects old, classic, current and Yoast method of tracking pageviews. +* Changed the default content container setting to match Twenty Fifteen. +* Core themes are supported except for Twenty Eleven. Theme notification only shows now if not a core theme. +* Corrected a loading issue of the template file should the theme have one also. +* Improved the partial content template file. Now has a fallback. Should be more compatible with themes. +* Added a support tab to the plugin settings page. +* Added a upgrade link on the plugins page. +* Added a community support link on the plugins page. +* Added the German translation. +* Redefined the constants. +* Moved admin functions under the directory 'includes/admin' +* Moved library assets under a new folder for both CSS and JavaScript. +* Added PHP detection. +* Improved copy in the settings page and the help tab. +* Updated the default localization file. +* Updated the readme.txt file with better copy. +* Removed public variables and hardcoded them into the plugin instead. +* Removed whitespace. +* Removed @return void on __construct() functions. +* Cleaned up the code. + ## 1.4.2 (31st July 2015) * Added two languages for localizing the plugin settings page. Français (French)(France) and Româna (Romanian). diff --git a/README.md b/README.md index e883c8d..a7bf312 100644 --- a/README.md +++ b/README.md @@ -1,46 +1,63 @@ ## Auto Load Next Post -[![Built with Grunt](https://cdn.gruntjs.com/builtwith.png?style=flat)](http://gruntjs.com/) [![GitHub forks](https://img.shields.io/github/forks/seb86/Auto-Load-Next-Post.svg?style=flat)](https://github.com/seb86/Auto-Load-Next-Post/network) [![GitHub license](https://img.shields.io/badge/license-GPLv3-blue.svg?style=flat)](https://raw.githubusercontent.com/seb86/Auto-Load-Next-Post/master/license.txt) [![WordPress plugin](https://img.shields.io/wordpress/plugin/v/auto-load-next-post.svg?style=flat)](https://wordpress.org/plugins/auto-load-next-post/) [![WordPress](https://img.shields.io/wordpress/plugin/dt/auto-load-next-post.svg?style=flat)](https://wordpress.org/plugins/auto-load-next-post/) [![WordPress](https://img.shields.io/wordpress/v/auto-load-next-post.svg?style=flat)](https://wordpress.org/plugins/auto-load-next-post/) +[![Built with Grunt](https://cdn.gruntjs.com/builtwith.png?style=flat)](http://gruntjs.com/) [![GitHub forks](https://img.shields.io/github/forks/seb86/Auto-Load-Next-Post.svg?style=flat)](https://github.com/seb86/Auto-Load-Next-Post/network) [![GitHub license](https://img.shields.io/badge/license-GPLv3-blue.svg?style=flat)](https://raw.githubusercontent.com/seb86/Auto-Load-Next-Post/master/license.txt) [![WordPress plugin](https://img.shields.io/wordpress/plugin/v/auto-load-next-post.svg?style=flat)](https://wordpress.org/plugins/auto-load-next-post/) [![WordPress](https://img.shields.io/wordpress/plugin/dt/auto-load-next-post.svg?style=flat)](https://wordpress.org/plugins/auto-load-next-post/) [![WordPress](https://img.shields.io/wordpress/v/auto-load-next-post.svg?style=flat)](https://wordpress.org/plugins/auto-load-next-post/) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/seb86/Auto-Load-Next-Post/badges/quality-score.png)](https://scrutinizer-ci.com/g/seb86/Auto-Load-Next-Post/) -Have you ever felt tired of going back and forth between blog posts? I know I have so I decided to develop a solution. One where you would need to do very little coding and require very little to set up on your blog. +Have you ever felt tired of going back and forth between blog posts? I know I have so I developed a solution, one where you would need no coding or very little required to set up on your blog. [![Auto Load Next Post Video](https://raw.githubusercontent.com/seb86/Auto-Load-Next-Post/master/youtube-video-screenshot.png)](https://www.youtube.com/watch?v=EvBCPXVe2U4) -### What is it? -Auto Load Next Post is a lightweight plugin that simply loads the previous post, one after another as you scroll down the page. It simply reads the post navigation in your theme at the end of each post and collects the post URL for the previous post. WordPress will then do a partial load and place the content of the previous post underneath the parent post. +### What is Auto Load Next Post? +Auto Load Next Post loads the next post once the bottom of the first post the user visits has been reached. The process is repeated until there are no more posts to load. -Not only that, it updates your web history by manipulating the web address and page title. This allows you to return to any post you have looked at in your browser history. When you refresh the page, the page will take you to the post you were viewing last. +It simply reads the post navigation in the theme at the end of each post and collects the post URL for the next post / page. WordPress will then do a partial load and place the content of the next post underneath the parent post / page. + +Not only that, it updates your web history by manipulating the web address and page title. This allows you to return to any post you have looked at in your browser history. When you refresh the browser, it will load the post / page the user was viewing last. + +### First Time Users +For new first time users I suggest reading [the documentation](https://github.com/seb86/Auto-Load-Next-Post/wiki) to understand how to setup the plugin and see how it works. By default when the plugin is activated, the settings are ready to be used with the latest WordPress core theme, Twenty Fifteen. ### Features -* Can use action hooks to load content before and after the next post has loaded. -* Can restrict it to load only on specific post types. -* You now have the option to hide the comments if you wish. +* Use action hooks to load content before and after the next post has loaded. +* Restrict it to load only on specific post types. +* Have the option to hide the comments if you wish. * Track each post load with Google Analytics. ( Requires Google Analytics to be applied for this to work. ) +* Over-writable template file. -### Documentation -Documentation, for this plugin, can be found at the GitHub repository [Wiki](https://github.com/seb86/Auto-Load-Next-Post/wiki). +> #### Auto Load Next Post Premium +> There's an even better version of the plugin coming out soon with priority email support.
      +> +> [More information](https://www.sebastiendumont.com/plugins/auto-load-next-post-premium/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=after-features-info-link) | [Sign up to be notified >>](http://eepurl.com/bvLz2H) -### Contributing and reporting bugs -You can [contribute code](https://github.com/seb86/Auto-Load-Next-Post/blob/master/CONTRIBUTING.md) to this plugin via the [GitHub](https://github.com/seb86/Auto-Load-Next-Post/blob/master/CONTRIBUTING.md) repository and localizations are translated via [Transifex](https://www.transifex.com/projects/p/auto-load-next-post/). +### Contributing +You can [contribute code](https://github.com/seb86/Auto-Load-Next-Post/blob/master/CONTRIBUTING.md) to this plugin via the [GitHub](https://github.com/seb86/Auto-Load-Next-Post/blob/master/CONTRIBUTING.md) repository and localizations via [Transifex](https://www.transifex.com/projects/p/auto-load-next-post/). ### Forum Support and Issue Reporting -Use the WordPress.org forums for [community support](https://wordpress.org/support/plugin/auto-load-next-post). I will do my best to respond. You may get or see a response from someone who has a similar issue already posted. If you spot a bug, you can of course log it as an [issue](https://github.com/seb86/Auto-Load-Next-Post/issues) on [Github](https://github.com/seb86/Auto-Load-Next-Post/issues) instead where I can act upon it more efficiently. +Use the WordPress.org forum for [community support](https://wordpress.org/support/plugin/auto-load-next-post). As this is a free plugin I can not provide support full time but I will do my best to respond. You are most likely to get a response from a none developer. + +You may also find that a topic similar to yours has already been posted so join in rather than creating a new support ticket with the same issue. -If you need help with any customizations for this plugin. Please consider [hiring me](http://www.sebastiendumont.com/hire-me/) to apply them. +If you spot a bug within the plugin, you can of course log it as an [issue](https://github.com/seb86/Auto-Load-Next-Post/issues) on Github where I can act upon it more efficiently. + +If you need help with any customizations for this plugin. Please [hire me](http://www.sebastiendumont.com/hire-me/) to apply them for you. ### Demo Site -Want to try it out? [Go to the demo site](http://demos.sebastiendumont.com/auto-load-next-post/) and view a post. Scroll down and see the plugin in action. +Want to try it out? [Go to the demo site](http://demo.autoloadnextpost.com) and view a post. Scroll down and see the plugin in action. + +### Support by Donating +Donations of any sum help keep this plugin actively developed and supported. Your support goes along way in making this plugin better. (Make a Donation)[https://donorbox.org/auto-load-next-post] + +### Leave a Review +Reviews are helpful to other users and this plugin reputation. Please consider spending a minute or two leaving a [review](https://wordpress.org/support/view/plugin-reviews/auto-load-next-post?rate=5#postform) and tell me what you think about the plugin. It matters a lot and is most appreciated. -### Support the plugin by Donations and Reviews -To keep this plugin working and support as many themes as possible, please consider making a [donation](https://www.sebastiendumont.com/donation/) or simply [write a review](https://wordpress.org/support/view/plugin-reviews/auto-load-next-post?rate=5#postform) about it. +### Languages and Translation Support +Current languages available: English(US), Français (French)(France), German (Germany), Italian (Italy), Româna (Romanian) -### Languages -Auto Load Next Post is currently available in 3 languages with more on the way. The folks over at WP Translations handle the translations, and it's because of them that these translations are available. More are on the way and with your help they can be released quicker. If you would like to help translate, go to the [Transifex](https://www.transifex.com/projects/p/auto-load-next-post/) project. +Auto Load Next Post is currently available in 5 languages with more on the way. The folks over at WP Translations handle the translations, and it's because of them that these translations are available. More are on the way and with your help they can be released quicker. If you would like to help translate, go to the [Transifex](https://www.transifex.com/projects/p/auto-load-next-post/) project. -#### Current Translations Available -* English (US) -* Français (French)(France) -* Română (Romanian) +> #### PHP Requirement +> This plugin requires PHP version 5.3 or higher.
      +> If you're still at PHP 5.2, it's time to update. [Read here why and how](http://www.wpupdatephp.com/update/)
      +> Updating to a newer PHP version is almost always done in minutes and free of charge! ### More information * Other [WordPress plugins](http://profiles.wordpress.org/sebd86/) by [Sébastien Dumont](http://www.sebastiendumont.com/) diff --git a/readme.txt b/readme.txt index 80c26fb..def7f98 100644 --- a/readme.txt +++ b/readme.txt @@ -59,9 +59,9 @@ Donations of any sum help keep this plugin actively developed and supported. You Reviews are helpful to other users and this plugin reputation. Please consider spending a minute or two leaving a [review](https://wordpress.org/support/view/plugin-reviews/auto-load-next-post?rate=5#postform) and tell me what you think about the plugin. It matters a lot and is most appreciated. = Languages and Translation Support = -Current languages available: English(US), Français (French)(France), German (Germany), Româna (Romanian) +Current languages available: English(US), Français (French)(France), German (Germany), Italian (Italy), Româna (Romanian) -Auto Load Next Post is currently available in 4 languages with more on the way. The folks over at WP Translations handle the translations, and it's because of them that these translations are available. More are on the way and with your help they can be released quicker. If you would like to help translate, go to the [Transifex](https://www.transifex.com/projects/p/auto-load-next-post/) project. +Auto Load Next Post is currently available in 5 languages with more on the way. The folks over at WP Translations handle the translations, and it's because of them that these translations are available. More are on the way and with your help they can be released quicker. If you would like to help translate, go to the [Transifex](https://www.transifex.com/projects/p/auto-load-next-post/) project. > #### PHP Requirement > This plugin requires PHP version 5.3 or higher.
      @@ -119,7 +119,7 @@ A.6 Well, WordPress loads posts in descending order by default so the next post == Changelog == -= 1.4.3 : 19th October 2015 = += 1.4.3 : 20th October 2015 = * Corrected undefined function for Google Analytics tracking in the JavaScript. * Improved Google Analytics. Now detects old, classic, current and Yoast method of tracking pageviews. * Changed the default content container setting to match Twenty Fifteen. @@ -136,6 +136,7 @@ A.6 Well, WordPress loads posts in descending order by default so the next post * Added PHP detection. * Improved copy in the settings page and the help tab. * Updated the default localization file. +* Updated the readme.txt file with better copy. * Removed public variables and hardcoded them into the plugin instead. * Removed whitespace. * Removed @return void on __construct() functions.