diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 23cb790..0000000 --- a/LICENSE +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - {description} - Copyright (C) {year} {fullname} - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - {signature of Ty Coon}, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/README.md b/README.md index 7ba6893..2f5a770 100644 --- a/README.md +++ b/README.md @@ -48,12 +48,26 @@ Note: Use `custom_permalinks_like_query` filter if the URLs doesn't works for yo ## Thanks for the Support! -The support from the users that love Custom Permalinks is huge. You can support Custom Permalinks's future development and help to make it even better by donating or even giving a 5 star rating with a nice message to me :) +I does not always provide active support for the Custom Permalinks plugin on the WordPress.org forums, as i have prioritize the email support. +One-on-one email support is available to people who bought [Custom Permalinks Premium](https://www.custompermalinks.com/#pricing-section) only. -[Donate to Custom Permalinks](https://www.paypal.me/yasglobal) +## Bug reports -## Installation +Bug reports for Custom Permalinks are [welcomed on GitHub](https://github.com/yasglobal/custom-permalinks). Please note GitHub is not a support forum, and issues that aren't properly qualified as bugs will be closed. -1. Unzip the package, and upload `custom-permalinks` to the `/wp-content/plugins/` directory -2. Activate the plugin through the 'Plugins' menu in WordPress -3. Edit any post, page, tag or category to set a custom permalink. +== Installation == + +This process defines you the steps to follow either you are installing through WordPress or Manually from FTP. + +## From within WordPress + +1. Visit 'Plugins > Add New' +2. Search for Custom Permalinks +3. Activate Custom Permalinks from your Plugins page. +4. Go to "after activation" below. + +## Manually + +1. Upload the `custom-permalinks` folder to the `/wp-content/plugins/` directory +2. Activate Custom Permalinks through the 'Plugins' menu in WordPress +3. Go to "after activation" below. diff --git a/admin/class-custom-permalinks-about.php b/admin/class-custom-permalinks-about.php new file mode 100644 index 0000000..ed7f31d --- /dev/null +++ b/admin/class-custom-permalinks-about.php @@ -0,0 +1,147 @@ +more_plugins(); + } + + /** + * More Plugins HTML + */ + private function more_plugins() { + $plugin_url = plugins_url( '/admin', CUSTOM_PERMALINKS_FILE ); + $img_src = $plugin_url . '/images'; + wp_enqueue_style( 'style', $plugin_url . '/css/about-plugins.min.css' ); + $plugin_name = __( 'Custom Permalinks', 'custom-permalinks' ); + $button_text = __( 'Check it out', 'custom-permalinks' ); + $five_star = ' + + + + + + + + + + + + + + + + '; + ?> + +
+
+

+
+

+

%s rating with a nice message to me :)', 'custom-permalinks' ), 'https://wordpress.org/support/plugin/custom-permalinks/reviews/?rate=5#new-post', $five_star ); ?>

+
+
+ +
+ +
+ +
+

+ + + +
+
+ +
+ +

+

+ +
+ + + +
+
+ +
+ +

+

+ +
+ +
+
+ +
+ +

+

Post, Category, Archive, Image URLs and Script and Style src as per your requirement. You can choose which you want to be relative from the setttings Page.', 'custom-permalinks' ); ?>

+ +
+ +
+
+ +
+ +

+

SCHEMA types like Article, News Article, Organization and Website Schema.', 'custom-permalinks' ); ?>

+ +
+ +
+
+ +
+ +

+

shortlink, rsd_link, wlwmanifest_link, emoji_scripts, wp_embed, wp_json, emoji_styles, generator and so on.', 'custom-permalinks' ); ?>

+ +
+ +
+
+ +
+ +

+

attachment post with the permalink of /services/ and doesn\'t allow you to use that permalink to point your page. In this case, we comes up with this great solution.', 'custom-permalinks' ); ?>

+ +
+
+
+ query( "DELETE FROM $wpdb->postmeta WHERE post_id IN ($post_ids) AND meta_key = 'custom_permalink'" ); } else { - $error = '

' . __( 'There is some error to proceed your request. Please retry with your request or contact to the plugin author.', 'custom-permalinks' ) . '

'; + $error = '
+

' . __( 'There is some error to proceed your request. Please retry with your request or contact to the plugin author.', 'custom-permalinks' ) . '

+
'; } } $html .= '
-

' . __( 'PostTypes Permalinks', 'custom-permalinks' ) . '

'; +

' . __( 'PostTypes Permalinks', 'custom-permalinks' ) . '

'; $html .= $error; $search_value = ''; @@ -55,12 +74,13 @@ public function custom_permalinks_post_permalinks() { $html .= 'Search results for "' . $search_value . '"'; } $page_limit = 'LIMIT 0, 20'; - if ( isset( $_GET['paged'] ) && is_numeric( $_GET['paged'] ) && $_GET['paged'] > 1 ) { - $pager = 20 * ( $_GET['paged'] - 1 ); + if ( isset( $_GET['paged'] ) && is_numeric( $_GET['paged'] ) + && $_GET['paged'] > 1 ) { + $pager = 20 * ( $_GET['paged'] - 1 ); $page_limit = 'LIMIT ' . $pager . ', 20'; } - $sorting_by = 'ORDER By p.ID DESC'; - $order_by = 'asc'; + $sorting_by = 'ORDER By p.ID DESC'; + $order_by = 'asc'; $order_by_class = 'desc'; if ( isset( $_GET['orderby'] ) && $_GET['orderby'] == 'title' ) { $filter_options .= ''; @@ -81,7 +101,7 @@ public function custom_permalinks_post_permalinks() { $html .= '
'; $html .= '
'; $html .= '
- - - + + +
'; $posts = 0; - if ( isset( $count_posts->total_permalinks ) && $count_posts->total_permalinks > 0 ) { + if ( isset( $count_posts->total_permalinks ) + && $count_posts->total_permalinks > 0 ) { $html .= '

Custom Permalink navigation

'; @@ -107,66 +128,91 @@ public function custom_permalinks_post_permalinks() { $posts = $wpdb->get_results( $query ); $pagination_html = ''; - $total_pages = ceil( $count_posts->total_permalinks / 20 ); - if ( isset( $_GET['paged'] ) && is_numeric( $_GET['paged'] ) && $_GET['paged'] > 0 ) { - $pagination_html = $this->custom_permalinks_pager( $count_posts->total_permalinks, $_GET['paged'], $total_pages ); + $total_pages = ceil( $count_posts->total_permalinks / 20 ); + if ( isset( $_GET['paged'] ) && is_numeric( $_GET['paged'] ) + && $_GET['paged'] > 0 ) { + $pagination_html = $this->cp_pager( + $count_posts->total_permalinks, $_GET['paged'], $total_pages + ); if ( $_GET['paged'] > $total_pages ) { - $redirect_uri = explode( '&paged=' . $_GET['paged'] . '', $_SERVER['REQUEST_URI'] ); + $redirect_uri = explode( + '&paged=' . $_GET['paged'] . '', $_SERVER['REQUEST_URI'] + ); header( 'Location: ' . $redirect_uri[0], 301 ); exit(); } } elseif ( ! isset( $_GET['paged'] ) ) { - $pagination_html = $this->custom_permalinks_pager( $count_posts->total_permalinks, 1, $total_pages ); + $pagination_html = $this->cp_pager( + $count_posts->total_permalinks, 1, $total_pages + ); } $html .= $pagination_html; } - $table_navigation = $this->custom_permalink_tablenav_posts( $order_by_class, $order_by, $search_permalink ); + $table_navigation = $this->tablenav_posts( + $order_by_class, $order_by, $search_permalink + ); $html .= '
'; $html .= ' - ' . $table_navigation . ' - '; + ' . $table_navigation . ' + '; if ( $posts != 0 && ! empty( $posts ) ) { foreach ( $posts as $post ) { $html .= ''; - $html .= ''; - $html .= ''; + $html .= ''; + $html .= ''; $html .= ''; - $html .= ''; + $html .= ''; + $html .= ''; } } else { - $html .= ''; + $html .= ' + + '; } $html .= '' . $table_navigation . '
' . $post->post_title . ' + + + ' . $post->post_title . ' + ' . ucwords( $post->post_type ) . 'post_title, "custom-permalinks" ) . '">/' . urldecode( $post->meta_value ) . '
+ post_title, "custom-permalinks" ) . '">/' . urldecode( $post->meta_value ) . ' +
No permalinks found.
No permalinks found.
'; $html .= '
-
- - - -
- ' . $pagination_html . ' +
+ + + +
+ ' . $pagination_html . '
'; $html .= '
'; echo $html; + + add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ), 1 ); } /** * Return the Navigation row HTML same as Default Posts page for PostTypes */ - private function custom_permalink_tablenav_posts( $order_by_class, $order_by, $search_permalink ) { + private function tablenav_posts( $order_by_class, $order_by, $search_permalink ) { $nav = ' - - ' . __( "Title", "custom-permalinks" ) . ' - ' . __( "Type", "custom-permalinks" ) . ' - ' . __( "Permalink", "custom-permalinks" ) . ' + + + + + + ' . __( "Title", "custom-permalinks" ) . ' + + ' . __( "Type", "custom-permalinks" ) . ' + ' . __( "Permalink", "custom-permalinks" ) . ' '; return $nav; } @@ -174,7 +220,7 @@ private function custom_permalink_tablenav_posts( $order_by_class, $order_by, $s /** * Shows all the Permalinks created by using this Plugin with Pager and Search Functionality of Category/Tags */ - public function custom_permalinks_category_permalinks() { + public function category_permalinks() { $search_permalink = ''; $html = ''; @@ -200,7 +246,7 @@ public function custom_permalinks_category_permalinks() { update_option( 'custom_permalink_table', $data ); } $html .= '
-

' . __( 'Category/Tags Permalinks', 'custom-permalinks' ) . '

'; +

' . __( 'Category/Tags Permalinks', 'custom-permalinks' ) . '

'; $search_value = ''; if ( isset( $_GET['s'] ) && ! empty( $_GET['s'] ) ) { @@ -212,11 +258,11 @@ public function custom_permalinks_category_permalinks() { $page_limit = 20; if ( isset( $_GET['paged'] ) && is_numeric( $_GET['paged'] ) && $_GET['paged'] > 1 ) { $pager_offset = 20 * ( $_GET['paged'] - 1 ); - $page_limit = $pager_offset + 20; + $page_limit = $pager_offset + 20; } $html .= '
'; $html .= ''; @@ -224,12 +270,12 @@ public function custom_permalinks_category_permalinks() { $html .= ''; $html .= '
'; $html .= '
- - - + + +
'; $posts = 0; @@ -241,7 +287,7 @@ public function custom_permalinks_category_permalinks() { $filtered = array(); if ( $search_value != '' ) { foreach ( $table as $key => $value ) { - if( preg_match( '/' . $search_value . '/', $key) ) { + if ( preg_match( '/' . $search_value . '/', $key) ) { $filtered[$key] = $value; } } @@ -252,28 +298,33 @@ public function custom_permalinks_category_permalinks() { $html .= '

Custom Permalink navigation

'; $total_pages = ceil( $count_tags / 20 ); - if ( isset( $_GET['paged'] ) && is_numeric( $_GET['paged'] ) && $_GET['paged'] > 0 ) { - $pagination_html = $this->custom_permalinks_pager( $count_tags, $_GET['paged'], $total_pages); + if ( isset( $_GET['paged'] ) && is_numeric( $_GET['paged'] ) + && $_GET['paged'] > 0 ) { + $pagination_html = $this->cp_pager( + $count_tags, $_GET['paged'], $total_pages + ); if ( $_GET['paged'] > $total_pages ) { - $redirect_uri = explode( '&paged=' . $_GET['paged'] . '', $_SERVER['REQUEST_URI'] ); + $redirect_uri = explode( + '&paged=' . $_GET['paged'] . '', $_SERVER['REQUEST_URI'] + ); header( 'Location: ' . $redirect_uri[0], 301 ); exit(); } } elseif ( ! isset( $_GET['paged'] ) ) { - $pagination_html = $this->custom_permalinks_pager( $count_tags, 1, $total_pages ); + $pagination_html = $this->cp_pager( $count_tags, 1, $total_pages ); } $html .= $pagination_html; } - $table_navigation = $this->custom_permalink_tablenav_category( $search_permalink ); + $table_navigation = $this->tablenav_category( $search_permalink ); $html .= '
'; $html .= ' - ' . $table_navigation . ' - '; + ' . $table_navigation . ' + '; if ( $table && is_array( $table ) && $count_tags > 0 ) { - uasort( $table, array( 'Custom_Permalinks_Admin', 'custom_permalinks_sort_array' ) ); + uasort( $table, array( 'Custom_Permalinks_Admin', 'sort_array' ) ); $i = -1; foreach ( $table as $permalink => $info ) { $i++; @@ -283,53 +334,66 @@ public function custom_permalinks_category_permalinks() { if ( $i >= $page_limit ) break; - $type = $info['kind'] == 'tag' ? 'post_tag' : 'category'; - $term = get_term( $info['id'], $type ); - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; + $type = $info['kind'] == 'tag' ? 'post_tag' : 'category'; + $term = get_term( $info['id'], $type ); + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; } } else { - $html .= ''; + $html .= ' + + '; } $html .= '' . $table_navigation . '
' . $term->name . '' . ucwords( $info['kind'] ) . 'name, "custom-permalinks" ) . '">/' . $permalink . '
+ + + ' . $term->name . ' + ' . ucwords( $info['kind'] ) . ' + name, "custom-permalinks" ) . '">/' . $permalink . ' +
No permalinks found.
No permalinks found.
'; $html .= '
-
- - - -
- ' . $pagination_html . ' +
+ + + +
+ ' . $pagination_html . '
'; $html .= '
'; echo $html; + + add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ), 1 ); } /** * Sort the terms array in desc order using term id */ - private static function custom_permalinks_sort_array( $a, $b ) { + private static function sort_array( $a, $b ) { return $b['id'] - $a['id']; } /** * Return the Navigation row HTML same as Default Posts page for Category */ - private function custom_permalink_tablenav_category( $search_permalink ) { + private function tablenav_category( $search_permalink ) { $nav = ' - - ' . __( "Title", "custom-permalinks" ) . ' - ' . __( "Type", "custom-permalinks" ) . ' - ' . __( "Permalink", "custom-permalinks" ) . ' + + + + ' . __( "Title", "custom-permalinks" ) . ' + ' . __( "Type", "custom-permalinks" ) . ' + ' . __( "Permalink", "custom-permalinks" ) . ' '; return $nav; } @@ -337,21 +401,23 @@ private function custom_permalink_tablenav_category( $search_permalink ) { /** * Return the Pager HTML */ - private function custom_permalinks_pager( $total_permalinks, $current_pager_value = 1, $total_pager = 0 ) { + private function cp_pager( $total_permalinks, $current_pager_value = 1, $total_pager = 0 ) { if ( $total_pager == 0 ) return; if ( $total_pager == 1 ) { $pagination_html = '
- ' . $total_permalinks . ' items + ' . $total_permalinks . ' items
'; return $pagination_html; } - $remove_pager_uri = explode( '&paged=' . $current_pager_value . '', $_SERVER['REQUEST_URI'] ); + $remove_pager_uri = explode( + '&paged=' . $current_pager_value . '', $_SERVER['REQUEST_URI'] + ); $pagination_html = '
- ' . $total_permalinks . ' items - '; + ' . $total_permalinks . ' items + '; if ( $current_pager_value == 1 ) { $pagination_html .= ' @@ -362,8 +428,8 @@ private function custom_permalinks_pager( $total_permalinks, $current_pager_valu $pagination_html .= ''; } else { $pagination_html .= ' - First page - + First page + '; } $pagination_html .= ' @@ -373,9 +439,9 @@ private function custom_permalinks_pager( $total_permalinks, $current_pager_valu } $pagination_html .= ' - - - of ' . $total_pager . ' + + + of ' . $total_pager . ' '; if ( $current_pager_value == $total_pager ) { @@ -384,8 +450,8 @@ private function custom_permalinks_pager( $total_permalinks, $current_pager_valu } else { $next_page = $current_pager_value + 1; $pagination_html .= ' - Next page - + Next page + '; if ( $total_pager == $next_page) { $pagination_html .= ''; @@ -395,11 +461,52 @@ private function custom_permalinks_pager( $total_permalinks, $current_pager_valu '; } - } $pagination_html .= '
'; return $pagination_html; } + /** + * Add About Plugins Page + */ + public function about_plugin() { + require_once( + CUSTOM_PERMALINKS_PATH . 'admin/class-custom-permalinks-about.php' + ); + new Custom_Permalinks_About(); + add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ), 1 ); + } + + /** + * Add Plugin Support and Follow Message in the footer of Admin Pages + */ + public function admin_footer_text() { + $footer_text = sprintf( + __( 'Custom Permalinks version %s by YAS Global - Support forums - Follow on Twitter: YAS Global', 'custom-permalinks' ), + CUSTOM_PERMALINKS_PLUGIN_VERSION, 'https://www.yasglobal.com', + 'https://wordpress.org/support/plugin/custom-permalinks', + 'https://twitter.com/samisiddiqui91' + ); + return $footer_text; + } + + /** + * Add About and Premium Settings Page Link on the Plugin Page + * under the Plugin Name. + */ + public function settings_link( $links ) { + $about = sprintf( + __( 'About', 'custom-permalinks' ), + 'admin.php?page=cp-about-plugins' + ); + $premium_support = sprintf( + __( 'Premium Support', 'custom-permalinks' ), + 'https://www.custompermalinks.com/#pricing-section' + ); + array_unshift( $links, $premium_support ); + array_unshift( $links, $about ); + + return $links; + } } diff --git a/admin/css/about-plugins.css b/admin/css/about-plugins.css new file mode 100644 index 0000000..5542062 --- /dev/null +++ b/admin/css/about-plugins.css @@ -0,0 +1,213 @@ +.wrap { + margin: 2em auto 1em; + max-width: 1090px; +} +.wrap .float { + width: calc(100% - 188px); + float: left; + box-sizing: border-box; +} +.wrap .float:nth-child(2) { + width: 128px; + margin: 40px 0 70px 50px; +} +.wrap h1 { + margin: 40px auto 20px; + font-size: 2.5em; +} +.tagline p { + font-size: 1.3em; + margin-bottom: 1em; + margin: 0 auto 1em; +} +p a { + text-decoration: none; +} +#footer-left a { + text-decoration: underline; +} +a .star svg polygon { + fill: #f9d539; +} +a .star svg:hover polygon { + fill: #ff7c00; +} +.product { + width: 100%; + display: inline-block; + text-align: center; +} +.product > span { + font-size: 1.3em; + margin-bottom: 1em; + display: block; + text-align: left; + margin: 0 auto 1em; +} +.product h2 { + display: block; + margin: 1em auto; + font-size: 2.2em; + text-align:left; +} +.product .box { + background-color: #fff; + width: 300px; + min-height: 200px; + text-align: center; + padding: 20px; + box-shadow: 2px 2px 3px #d1d1d1; + display: inline-block; + margin: 10px; + vertical-align: top; +} +.product .tagline{ + text-align: center; +} +.product .img { + background: #eee; + border-radius: 50%; + width: 150px; + height: 150px; + margin: 0 auto; +} +.product .img svg, +.product .img img { + max-width: 70%; + margin-top: 25px; +} +.product .h3 { + margin-bottom: 5px; +} + +.product p { + color: #888; + font-size: 14px; + line-height: 26px; + text-align: left; + transition: max-height 450ms 100ms ease; + margin: 1em 0 2em; +} +@media(min-width:746px) { + .product p { + min-height: 185px; + max-height: 135px; + overflow: hidden; + } + .product .box:hover p { + max-height: 300px + } +} +.box.recommended { + position: relative; + background: rgb(232, 235, 238); +} +.box.recommended * { + position: relative; + z-index:2; +} +.box.recommended:before { + content: ""; + position: absolute; + width: 100%; + height: 100%; + transition: all 350ms ease; + z-index: 1; + background: aliceblue; + right: 0; + top: 0; + background: linear-gradient(35deg, rgb(232, 235, 238) 62%,rgba(181,198,208,1) 50%); + transform-origin: top right; +} +@keyframes blinking { +0%,100%{opacity:0.1} +25%,75%{opacity:1} +} +.box.recommended:after { + content: "RECOMMENDED"; + position: absolute; + top: 41px; + right: -11px; + color: #fff; + font-size: 18px; + font-weight: bold; + transform: rotateZ(35deg); + font-family: sans-serif; + z-index: 1; + animation: blinking 2s infinite linear; +} +.box.recommended:hover:before { + height: 175px; + width: 150px; +} +.box.recommended:hover:after { + animation: blinking 2s 1 linear; +} + +.box > a { + display: inline-block; + float: right; + background: rgb(181,198,208); + color: #fff; + background: linear-gradient(-35deg, rgba(216,225,231,0.8) 12%,rgb(181,198,208) 13%); + text-decoration: none; + font-size:20px; + padding: 8px 17px; + border-radius: 3px; + transition: all 250ms ease; +} +.box > a:hover { + font-size: 22px; +} +@media(max-width:991px) { + .wrap { + max-width: 725px; + } +} +@media(max-width:767px) { + .wrap { + max-width: 640px; + } + .product .box { + width: 258px; + min-height: 410px; + } +} +@media(max-width:650px){ + .wrap { + max-width: 460px; + } + .product .box { + width: 400px; + max-width: 90%; + min-height: inherit; + margin-left: 0; + margin-right: 0; + box-sizing: border-box; + } + .wrap .float { + width: 100%; + } + .wrap .float:nth-child(2) { + margin: 40px 0 70px 50px; + position: absolute; + right: 20px; + } + .wrap h1 { + margin: 70px 0 30px; + width: 300px; + line-height: 1.2em; + } +} +@media(max-width:450px) { + .wrap h1 { + margin: 0px 0 150px; + font-size: 2em; + width: 300px; + } + .wrap .float:nth-child(2) { + right: inherit; + margin: 80px auto 0; + text-align: center; + } +} \ No newline at end of file diff --git a/admin/css/about-plugins.min.css b/admin/css/about-plugins.min.css new file mode 100644 index 0000000..9733442 --- /dev/null +++ b/admin/css/about-plugins.min.css @@ -0,0 +1 @@ +.wrap{margin:2em auto 1em;max-width:1090px}.wrap .float{width:calc(100% - 188px);float:left;box-sizing:border-box}.wrap .float:nth-child(2){width:128px;margin:40px 0 70px 50px}.wrap h1{margin:40px auto 20px;font-size:2.5em}.tagline p{font-size:1.3em;margin:0 auto 1em}p a{text-decoration:none}#footer-left a{text-decoration:underline}a .star svg polygon{fill:#f9d539}a .star svg:hover polygon{fill:#ff7c00}.product{width:100%;display:inline-block;text-align:center}.product > span{font-size:1.3em;display:block;text-align:left;margin:0 auto 1em}.product h2{display:block;margin:1em auto;font-size:2.2em;text-align:left}.product .box{background-color:#fff;width:300px;min-height:200px;text-align:center;padding:20px;box-shadow:2px 2px 3px #d1d1d1;display:inline-block;margin:10px;vertical-align:top}.product .tagline{text-align:center}.product .img{background:#eee;border-radius:50%;width:150px;height:150px;margin:0 auto}.product .img svg,.product .img img{max-width:70%;margin-top:25px}.product .h3{margin-bottom:5px}.product p{color:#888;font-size:14px;line-height:26px;text-align:left;transition:max-height 450ms 100ms ease;margin:1em 0 2em}@media(min-width:746px){.product p{min-height:185px;max-height:135px;overflow:hidden}.product .box:hover p{max-height:300px}}.box.recommended{position:relative;background:#e8ebee}.box.recommended *{position:relative;z-index:2}.box.recommended:before{content:"";position:absolute;width:100%;height:100%;transition:all 350ms ease;z-index:1;background:#f0f8ff;right:0;top:0;background:linear-gradient(35deg,#e8ebee 62%,rgba(181,198,208,1) 50%);transform-origin:top right}@keyframes blinking{0%,100%{opacity:.1}25%,75%{opacity:1}}.box.recommended:after{content:"RECOMMENDED";position:absolute;top:41px;right:-11px;color:#fff;font-size:18px;font-weight:700;transform:rotateZ(35deg);font-family:sans-serif;z-index:1;animation:blinking 2s infinite linear}.box.recommended:hover:before{height:175px;width:150px}.box.recommended:hover:after{animation:blinking 2s 1 linear}.box > a{display:inline-block;float:right;background:#b5c6d0;color:#fff;background:linear-gradient(-35deg,rgba(216,225,231,0.8) 12%,#b5c6d0 13%);text-decoration:none;font-size:20px;padding:8px 17px;border-radius:3px;transition:all 250ms ease}.box > a:hover{font-size:22px}@media(max-width:991px){.wrap{max-width:725px}}@media(max-width:767px){.wrap{max-width:640px}.product .box{width:258px;min-height:410px}}@media(max-width:650px){.wrap{max-width:460px}.product .box{width:400px;max-width:90%;min-height:inherit;margin-left:0;margin-right:0;box-sizing:border-box}.wrap .float{width:100%}.wrap .float:nth-child(2){margin:40px 0 70px 50px;position:absolute;right:20px}.wrap h1{margin:70px 0 30px;width:300px;line-height:1.2em}}@media(max-width:450px){.wrap h1{margin:0 0 150px;font-size:2em;width:300px}.wrap .float:nth-child(2){right:inherit;margin:80px auto 0;text-align:center}} \ No newline at end of file diff --git a/admin/images/custom-permalinks.svg b/admin/images/custom-permalinks.svg new file mode 100644 index 0000000..43fc217 --- /dev/null +++ b/admin/images/custom-permalinks.svg @@ -0,0 +1,23 @@ + + Custom Permalinks + + + + + + + \ No newline at end of file diff --git a/admin/images/http-auth.svg b/admin/images/http-auth.svg new file mode 100644 index 0000000..a6a18ae --- /dev/null +++ b/admin/images/http-auth.svg @@ -0,0 +1,84 @@ + +Http Auth + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/admin/images/json-structuring-markup.svg b/admin/images/json-structuring-markup.svg new file mode 100644 index 0000000..90a87e2 --- /dev/null +++ b/admin/images/json-structuring-markup.svg @@ -0,0 +1,1043 @@ + + JSON Structuring Markup + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/admin/images/make-paths-relative.svg b/admin/images/make-paths-relative.svg new file mode 100644 index 0000000..8032ca5 --- /dev/null +++ b/admin/images/make-paths-relative.svg @@ -0,0 +1,62 @@ + + Make Paths Relative + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/admin/images/media-post-permalink.png b/admin/images/media-post-permalink.png new file mode 100644 index 0000000..82ff8d1 Binary files /dev/null and b/admin/images/media-post-permalink.png differ diff --git a/admin/images/media-post-permalink.svg b/admin/images/media-post-permalink.svg new file mode 100644 index 0000000..9e27678 --- /dev/null +++ b/admin/images/media-post-permalink.svg @@ -0,0 +1,6483 @@ + + Media Post Permalink + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/admin/images/permalinks-customizer.svg b/admin/images/permalinks-customizer.svg new file mode 100644 index 0000000..a3a3a07 --- /dev/null +++ b/admin/images/permalinks-customizer.svg @@ -0,0 +1,31 @@ + +Permalink Customizer + + + + + + + + + + + + + diff --git a/admin/images/prevent-xss-vulnerability.png b/admin/images/prevent-xss-vulnerability.png new file mode 100644 index 0000000..fdb309d Binary files /dev/null and b/admin/images/prevent-xss-vulnerability.png differ diff --git a/admin/images/prevent-xss-vulnerability.svg b/admin/images/prevent-xss-vulnerability.svg new file mode 100644 index 0000000..afa43eb --- /dev/null +++ b/admin/images/prevent-xss-vulnerability.svg @@ -0,0 +1,10 @@ + + + + +Prevent XSS Vulnerability + + + diff --git a/admin/images/remove-links-and-scripts.svg b/admin/images/remove-links-and-scripts.svg new file mode 100644 index 0000000..f7ed63a --- /dev/null +++ b/admin/images/remove-links-and-scripts.svg @@ -0,0 +1,329 @@ + +Remove Links and Scripts + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/admin/images/schema-for-article.svg b/admin/images/schema-for-article.svg new file mode 100644 index 0000000..811b018 --- /dev/null +++ b/admin/images/schema-for-article.svg @@ -0,0 +1,56 @@ + +SCHEMA for Article + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/custom-permalinks-main.php b/custom-permalinks-main.php index 8521dd6..73c0323 100644 --- a/custom-permalinks-main.php +++ b/custom-permalinks-main.php @@ -15,10 +15,14 @@ exit(); } -define( 'CUSTOM_PERMALINKS_PLUGIN_VERSION', '1.2.10' ); +define( 'CUSTOM_PERMALINKS_PLUGIN_VERSION', '1.2.11' ); if ( ! defined( 'CUSTOM_PERMALINKS_PATH' ) ) { - define( 'CUSTOM_PERMALINKS_PATH', plugin_dir_path( __FILE__ ) ); + define( 'CUSTOM_PERMALINKS_PATH', plugin_dir_path( CUSTOM_PERMALINKS_FILE ) ); +} + +if ( ! defined( 'CUSTOM_PERMALINKS_BASENAME' ) ) { + define( 'CUSTOM_PERMALINKS_BASENAME', plugin_basename( CUSTOM_PERMALINKS_FILE ) ); } require_once( CUSTOM_PERMALINKS_PATH . 'frontend/class-custom-permalinks-frontend.php' ); @@ -38,6 +42,8 @@ * Add textdomain hook for translation */ function custom_permalinks_translation_capability() { - load_plugin_textdomain( 'custom-permalinks', FALSE, basename( dirname( __FILE__ ) ) . '/languages/' ); + load_plugin_textdomain( 'custom-permalinks', FALSE, + CUSTOM_PERMALINKS_BASENAME . '/languages/' + ); } -add_action( 'plugins_loaded', 'custom_permalinks_translation_capability' ); \ No newline at end of file +add_action( 'plugins_loaded', 'custom_permalinks_translation_capability' ); diff --git a/custom-permalinks.php b/custom-permalinks.php index 8867910..9418ab4 100644 --- a/custom-permalinks.php +++ b/custom-permalinks.php @@ -1,14 +1,13 @@ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * Copyright 2008-2018 Sami Ahmed Siddiqui * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ // Make sure we don't expose any info if called directly diff --git a/frontend/class-custom-permalinks-form.php b/frontend/class-custom-permalinks-form.php index 53b4893..f76daab 100644 --- a/frontend/class-custom-permalinks-form.php +++ b/frontend/class-custom-permalinks-form.php @@ -1,6 +1,6 @@ custom_permalinks_original_post_link( $id ); @@ -78,7 +78,9 @@ public function custom_permalinks_get_sample_permalink_html( $html, $id, $new_ti ob_start(); - require_once( CUSTOM_PERMALINKS_PATH . 'frontend/class-custom-permalinks-frontend.php' ); + require_once( + CUSTOM_PERMALINKS_PATH . 'frontend/class-custom-permalinks-frontend.php' + ); $custom_permalinks_frontend = new Custom_Permalinks_Frontend(); if ( $post->post_type == "page" ) { $original_page_url = $custom_permalinks_frontend->custom_permalinks_original_page_link( $id ); @@ -125,7 +127,9 @@ public function custom_permalinks_post_options() {

custom_permalinks_get_form( $permalink, $custom_permalinks_frontend->custom_permalinks_original_post_link( $post_id ) ); ?> @@ -145,13 +149,14 @@ public function custom_permalinks_page_options() { } $permalink = get_post_meta( $post_id, 'custom_permalink', true ); - ?>

custom_permalinks_original_page_link( $post_id ); $this->custom_permalinks_get_form( $permalink, $page_permalink ); @@ -166,11 +171,13 @@ public function custom_permalinks_page_options() { */ public function custom_permalinks_term_options( $object ) { if ( is_object( $object ) && isset( $object->term_id ) ) { - require_once( CUSTOM_PERMALINKS_PATH . 'frontend/class-custom-permalinks-frontend.php' ); + require_once( + CUSTOM_PERMALINKS_PATH . 'frontend/class-custom-permalinks-frontend.php' + ); $custom_permalinks_frontend = new Custom_Permalinks_Frontend(); $permalink = $custom_permalinks_frontend->custom_permalinks_permalink_for_term( $object->term_id ); - if ( $object->term_id ) { + if ( $object->term_id ) { if ( $object->taxonomy == 'post_tag' ) { $originalPermalink = $custom_permalinks_frontend->custom_permalinks_original_tag_link( $object->term_id ); } else { @@ -198,19 +205,19 @@ public function custom_permalinks_term_options( $object ) { /** * Helper function to render form */ - private function custom_permalinks_get_form( $permalink, $original = "", $renderContainers = true, $postname = "" ) { + private function custom_permalinks_get_form( $permalink, $original = '', $renderContainers = true, $postname = '' ) { ?> - - - +