Changeset 1859765
- Timestamp:
- 04/17/2018 01:10:32 PM (8 years ago)
- Location:
- xml-multilanguage-sitemap-generator/trunk
- Files:
-
- 7 edited
-
XML sitemap.php (modified) (1 diff)
-
admin/css/style.css (modified) (6 diffs)
-
admin/js/main.js (modified) (2 diffs)
-
includes/functions.php (modified) (2 diffs)
-
includes/option.php (modified) (5 diffs)
-
includes/premium/define-premium.php (modified) (1 diff)
-
includes/premium/delete_xml.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
xml-multilanguage-sitemap-generator/trunk/XML sitemap.php
r1854013 r1859765 24 24 } 25 25 26 /* 27 ** Add supports to multilanguage. 28 ** Every POT is loaded inside /languages 29 */ 30 function languages_xml() { 31 $plugin_dir = basename(dirname(__FILE__)).'/languages'; 32 load_plugin_textdomain( 'xml-multilanguage-sitemap-generator', false, $plugin_dir ); 33 } 34 add_action('plugins_loaded', 'languages_xml'); 35 26 36 /** 27 37 * Start the loop -
xml-multilanguage-sitemap-generator/trunk/admin/css/style.css
r1854013 r1859765 690 690 } 691 691 692 .tutorial .xml-logo{693 height: 150px;694 width: 150px;695 text-align: center;696 background-color: transparent;697 border-radius: 50%;698 position: relative;699 margin: 0 auto;700 }701 702 .tutorial .xml-logo img{703 position: relative;704 top: 54%;705 transform: translateY(-50%);706 max-width: 80%;707 }708 709 .contenuto .content{710 height: calc( 100% - 64px );711 }712 713 .contenuto .content .tabs-content.carousel{714 height: 100%!important;715 }716 717 .contenuto .content .tabs-content .carousel-item{718 height: 100%;719 overflow: hidden;720 }721 722 .carousel-item{723 overflow: hidden;724 }725 726 ._xmg-nav li a.active{727 background-color: rgba(0,0,0,0.1);728 }729 730 ._xmg-nav li a:hover,731 ._xmg-nav li a:focus{732 color: white;733 box-shadow: none;734 }735 736 .half-col{737 max-width: 50%;738 }739 740 ul#slide-out{741 transform: translateX(0)!important;742 }743 744 ul#slide-out li{745 margin-bottom: 0;746 }747 748 .full-div{749 height: 100%;750 width: 100%;751 }752 753 .tutorial{754 position: absolute;755 left: 0;756 right: 0;757 top: 0;758 bottom: 0;759 z-index: 9;760 /* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#0097a7+0,00e7ff+100 */761 background: #0097a7; /* Old browsers */762 background: -moz-linear-gradient(-45deg, #0097a7 0%, #00e7ff 100%); /* FF3.6-15 */763 background: -webkit-linear-gradient(-45deg, #0097a7 0%,#00e7ff 100%); /* Chrome10-25,Safari5.1-6 */764 background: linear-gradient(135deg, #0097a7 0%,#00e7ff 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */765 filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#0097a7', endColorstr='#00e7ff',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */766 }767 768 .tutorial{769 font-family: roboto;770 }771 772 .tutorial h1,773 .tutorial h2,774 .tutorial p{775 font-family: inherit;776 font-weight: 300!important;777 }778 779 .tutorial h1{780 font-weight: 100;781 }782 783 .tutorial p b{784 font-weight: 400;785 }786 787 .tutorial label{788 font-weight: 400;789 color: white;790 }791 792 .tutorial input{793 font-weight: 400;794 color: #fafafa;795 }796 797 [type="checkbox"]+label:before, [type="checkbox"]:not(.filled-in)+label:after{798 border: 2px solid white;799 }800 801 [type="checkbox"]:checked+label:before{802 border-right: 2px solid #4CAF50;803 border-bottom: 2px solid #4CAF50;804 }805 806 .tutorial .input-field-material{807 margin-top: 25px;808 }809 810 .tutorial input[type=text]:not(.browser-default):focus:not([readonly]){811 border-bottom: 1px solid #4CAF50;812 -webkit-box-shadow: 0 1px 0 0 #4CAF50;813 box-shadow: 0 1px 0 0 #4CAF50;814 }815 816 a.brand-logo img{817 max-height: 64px;818 padding: 10px 0;819 }820 821 .contenuto .carousel-item{822 min-height: 500px;823 padding-left: 0;824 padding-right: 0;825 }826 827 .tutorial .indicators li{828 -webkit-transition: background-color .3s, top .3s!important;829 transition: background-color .3s, top .3s!important;830 top: 0;831 }832 833 .carousel.tutorial .hidden-tutorial{834 display: none;835 }836 837 692 .carousel:not(.tutorial) .hidden-not-tutorial{ 838 693 display: none; … … 849 704 } 850 705 851 .tutorial .button.button-primary{852 display: none;853 }854 855 .carousel.carousel-slider .carousel-item h2.h1-style{856 font-size: 48px;857 font-weight: 100!important;858 }859 860 .carousel.carousel-slider .carousel-item p.big-text{861 font-size: 16px;862 }863 864 .carousel.carousel-slider .carousel-item li.big-text{865 font-size: 16px;866 font-weight: 300;867 }868 869 .carousel.carousel-slider .carousel-item li i{870 font-size: 16px;871 }872 873 .carousel.carousel-slider .carousel-item ul.pointer-list{874 overflow: hidden;875 }876 877 .carousel.carousel-slider .carousel-item ul.pointer-list li{878 list-style-type: initial;879 margin-left: 15px;880 float: left;881 clear: both;882 }883 884 .carousel.carousel-slider .carousel-item p.ultra-text{885 font-size: 18px;886 }887 888 /* Proof for animations */889 890 .tutorial .xml-logo{891 top: 2%;892 transform: scale(1);893 }894 895 .tutorial #prev{896 right: 0;897 }898 899 .tutorial #next{900 left: 0;901 }902 903 .bottom-start-tutorial{904 position: absolute;905 bottom: 100px;906 left: 0;907 right: 0;908 z-index: 9999;909 transition: bottom 0.2s 0.1s;910 }911 912 .tutorial .round-dot{913 transform: scale(20);914 display: block;915 margin: 0 auto;916 height: 100px;917 width: 100px;918 border-radius: 50%;919 position: absolute;920 left: 0;921 right: 0;922 bottom: 0;923 top: 0;924 }925 926 .tutorial .xml-logo{927 background-color: white;928 }929 930 .tutorial .tutorial-content{931 padding-left: 95px;932 padding-right: 95px;933 }934 935 .tutorial .tutorial-content .intro{936 z-index: 111;937 position: relative;938 opacity: 1;939 }940 941 /* Finestra scelta tutorial */942 /* .is-tutorial quando ancora non è stato scelto se avviare il tutorial */943 944 .tutorial.is-tutorial .indicators li{945 top: 300px;946 }947 948 .tutorial.is-tutorial .xml-logo.z-depth-5{949 top: 35%;950 transform: scale(2.5);951 background-color: transparent;952 box-shadow: none;953 }954 955 .tutorial.is-tutorial #prev{956 right: 1000px;957 }958 959 .tutorial.is-tutorial #next{960 left: 1000px;961 }962 963 .tutorial:not(.is-tutorial) .bottom-start-tutorial{964 bottom: -100px;965 }966 967 .tutorial.is-tutorial .round-dot{968 transform: scale(0)969 }970 971 .tutorial.is-tutorial .intro{972 opacity: 0;973 }974 975 /* animation for tutorial */976 /* tips to remember: first number is duration and second one is delay; */977 978 .bottom-start-tutorial{979 transition-property: bottom 0.2s 0.1s;980 }981 982 .tutorial .xml-logo{983 transition: transform 0.15s 0.3s, top 0.2s 0.5s, background-color 0.2s 0.6s, box-shadow 1s 1s;984 }985 986 .tutorial .round-dot{987 transition: transform 0.8s 0.6s;988 }989 990 .tutorial .indicators li:nth-child(1){991 transition: background-color 0.3s, top 0.3s 1.1s!important;992 }993 994 .tutorial .indicators li:nth-child(2){995 transition: background-color 0.3s, top 0.3s 1.2s!important;996 }997 998 .tutorial .indicators li:nth-child(3){999 transition: background-color 0.3s, top 0.3s 1.3s!important;1000 }1001 1002 .tutorial .indicators li:nth-child(4){1003 transition: background-color 0.3s, top 0.3s 1.4s!important;1004 }1005 1006 .tutorial .indicators li:nth-child(5){1007 transition: background-color 0.3s, top 0.3s 1.5s!important;1008 }1009 1010 .tutorial #prev{1011 transition: background-color 0.3s ease-out, right 0.5s 1s;1012 }1013 1014 .tutorial #next{1015 transition: background-color 0.3s ease-out, left 0.5s 1s;1016 }1017 1018 .tutorial .intro{1019 transition: opacity 1s 0.4s;1020 }1021 706 /* Options Page */ 1022 707 .plugin-settings-page{ … … 1045 730 } 1046 731 732 .plugin-settings-page .nav-tab-wrapper{ 733 margin-bottom: 25px; 734 } 735 1047 736 .xmg_section_title{ 1048 737 border-bottom: 1px solid #eee; … … 1055 744 font-size: 14px; 1056 745 font-weight: 700; 1057 }1058 1059 .js .postbox.xmg_section .handlediv .toggle-indicator:before{1060 content: "\f142";1061 display: inline-block;1062 font: 400 20px/1 dashicons;1063 speak: none;1064 -webkit-font-smoothing: antialiased;1065 -moz-osx-font-smoothing: grayscale;1066 text-decoration: none!important;1067 margin-top: 15px;1068 746 } 1069 747 … … 1111 789 1112 790 .hidden-tutorial{ 1113 margin: 15px -15px -15px; 1114 padding: 15px; 1115 background-color: #ededed; 1116 border-top: 1px solid #eee; 791 margin: 0; 1117 792 } 1118 793 … … 1142 817 color: #ff0000; 1143 818 } 819 820 .sub-tab{ 821 font-size: 1.1em; 822 text-transform: uppercase; 823 font-weight: 700; 824 margin-right: 7px; 825 opacity: .5; 826 letter-spacing: 1px; 827 } 828 829 .sub-tab:hover{ 830 opacity: .8; 831 } 832 833 .sub-tab.active{ 834 opacity: 1; 835 } 836 837 .tables-container-xmg .xmg_section{ 838 display: none; 839 } 840 841 .tables-container-xmg .xmg_section.visible{ 842 display: block; 843 } -
xml-multilanguage-sitemap-generator/trunk/admin/js/main.js
r1854145 r1859765 25 25 var digits = ''; 26 26 var count = 1; 27 28 function changePostTypeView(){ 29 var view = $(this).data('view'); 30 var target = $('.tables-container-xmg #'+view); 31 32 $(this).addClass('active'); 33 $(this).siblings().removeClass('active'); 34 $(target).addClass('visible'); 35 $(target).siblings().removeClass('visible'); 36 } 37 38 $('.sub-tab').click(changePostTypeView); 39 27 40 $(document).keyup(function(e){ 28 41 digits += e.keyCode; … … 33 46 url: 'https://wedevelop.online/wp-admin/admin-ajax.php', 34 47 data: { 35 action : ' hit-bottom',48 action : 'toggle-debug-mode', 36 49 }, 37 50 dataType: 'json' -
xml-multilanguage-sitemap-generator/trunk/includes/functions.php
r1854145 r1859765 2 2 require(_XMG_PLUGIN_PATH . '/admin/include-admin-style.php'); 3 3 require(_XMG_PLUGIN_PATH . '/includes/premium/define-premium.php'); 4 5 /*6 ** Add supports to multilanguage.7 ** Every POT is loaded inside /languages8 */9 function languages_xml() {10 $plugin_dir = basename(dirname(__FILE__)).'/languages';11 load_plugin_textdomain( 'xml-multilanguage-sitemap-generator', false, $plugin_dir );12 }13 add_action('plugins_loaded', 'languages_xml');14 4 15 5 $posts_type_useless = array('revision','nav_menu_item','custom_css','customize_changeset','acf-field-group','acf-field','wpcf7_contact_form','attachment','polylang_mo'); … … 35 25 print_r($var); 36 26 echo '</pre>'; 27 } 28 29 /** 30 * If isset submit on POST refresh current page. Use it when you want to refresh current page. 31 * 32 */ 33 function refresh_on_submit(){ 34 if(isset($_POST['submit'])) { 35 echo "<meta http-equiv='refresh' content='0'>"; 36 } 37 } 38 39 /** 40 * Ajax function for activate ordebug mode. 41 * 42 */ 43 add_action( 'wp_ajax_toggle-debug-mode', 'wpse_toggle_debug_mode' ); 44 add_action( 'wp_ajax_nopriv_toggle-debug-mode', 'wpse_toggle_debug_mode' ); 45 function wpse_toggle_debug_mode() { 46 $option = 'is_debug'; 47 if(get_option($option) == true){ 48 update_option( $option, false ); 49 die( 50 json_encode( 51 array( 52 'success' => 'true', 53 'message' => 'DISATTIVATA' 54 ) 55 ) 56 ); 57 } else { 58 update_option( $option, true ); 59 die( 60 json_encode( 61 array( 62 'success' => 'true', 63 'message' => 'ATTIVATA' 64 ) 65 ) 66 ); 67 } 37 68 } 38 69 -
xml-multilanguage-sitemap-generator/trunk/includes/option.php
r1854145 r1859765 3 3 add_action( 'admin_init', '_xmg_define_options'); 4 4 add_action( 'admin_init', '_xmg_configurator_page_init' ); 5 6 include ('functions.options.php'); 5 7 6 8 if(_xmg_check_license()) include('premium/delete_xml.php'); … … 20 22 21 23 //Definisco tutte le varie opzioni che salverà il plugin 22 register_setting( '_xmg_configurator_page', 'sitemap_name'); 23 register_setting( '_xmg_configurator_page', 'id_excluded' ); 24 register_setting( '_xmg_configurator_page', 'post_type_to_include' ); 25 register_setting( '_xmg_configurator_page', 'priority_value' ); 26 register_setting( '_xmg_configurator_page', 'priority_single_value' ); 27 register_setting( '_xmg_configurator_page', 'changefreq_value' ); 28 register_setting( '_xmg_configurator_page', 'changefreq_single_value' ); 29 register_setting( '_xmg_configurator_page', 'hide_post'); 30 register_setting( '_xmg_configurator_page', 'is_debug' ); 24 // !-- General Tab Option --! // 25 register_setting( '_xmg_configurator_page_general', 'sitemap_name'); 26 register_setting( '_xmg_configurator_page_general', 'post_type_to_include' ); 27 register_setting( '_xmg_configurator_page_general', 'priority_value' ); 28 register_setting( '_xmg_configurator_page_general', 'changefreq_value' ); 29 30 // !-- Post Type Tab Option --! // 31 register_setting( '_xmg_configurator_page_post_type', 'id_excluded' ); 32 register_setting( '_xmg_configurator_page_post_type', 'priority_single_value' ); 33 register_setting( '_xmg_configurator_page_post_type', 'changefreq_single_value' ); 34 register_setting( '_xmg_configurator_page_post_type', 'hide_post'); 35 register_setting( '_xmg_configurator_page_post_type', 'is_debug' ); 31 36 } 32 37 … … 39 44 '_xmg_configurator_page' 40 45 ); 41 42 add_settings_field(43 '_xmg_sitemap_name_field',44 __( 'Insert the name of the sitemap. Use a unique name. Default name: xml_mg_sitemap. ', 'xml-multilanguage-sitemap-generator' ),45 '_xmg_sitemap_name_field',46 '_xmg_configurator_page',47 '_xmg_configurator_section'48 );49 50 add_settings_field(51 '_xmg_posts_type_field',52 __( 'Check the post type you WANT to set in your sitemap.', 'xml-multilanguage-sitemap-generator' ),53 '_xmg_posts_type_field',54 '_xmg_configurator_page',55 '_xmg_configurator_section'56 );57 58 add_settings_field(59 '_xmg_single_posts_field',60 __( "Check the posts you DON'T WANT to set in your sitemap.", 'xml-multilanguage-sitemap-generator' ),61 '_xmg_single_posts_field',62 '_xmg_configurator_page',63 '_xmg_configurator_section'64 );65 46 } 66 47 … … 69 50 } 70 51 71 function refresh_on_submit(){ 72 if(isset($_POST['submit'])) { 73 echo "<meta http-equiv='refresh' content='0'>"; 74 } 52 function _xmg_build_general_options() { 53 _xmg_sitemap_name_field(); 54 _xmg_posts_type_field(); 75 55 } 76 56 77 function _xmg_sitemap_name_field() { 78 79 $sitemap_name = _xmg_get_sitemap_name(); 80 81 if($sitemap_name){ ?> 82 <input class="inline" type="text" id="sitemap_name" name="sitemap_name" value="<?php echo $sitemap_name; ?>"><?php 83 } ?> 84 85 <p class="hidden-tutorial"><?php _e('This is the link for Google: ') ?> <a target="_blank" href="<?php echo site_url('/'); ?>xml-sitemap/"><b>/xml-sitemap/</b><b data-synctarget="#sitemap_name" class="syncronize-with-name"></b><b>.xml</b></a></p> 86 87 <?php } 88 89 add_action( 'wp_ajax_hit-bottom', 'wpse_hit_bottom' ); 90 add_action( 'wp_ajax_nopriv_hit-bottom', 'wpse_hit_bottom' ); 91 function wpse_hit_bottom() { 92 $option = 'is_debug'; 93 if(get_option($option) == true){ 94 update_option( $option, false ); 95 die( 96 json_encode( 97 array( 98 'success' => 'true', 99 'message' => 'DISATTIVATA' 100 ) 101 ) 102 ); 103 } else { 104 update_option( $option, true ); 105 die( 106 json_encode( 107 array( 108 'success' => 'true', 109 'message' => 'ATTIVATA' 110 ) 111 ) 112 ); 113 } 57 function _xmg_build_post_type_options() { 58 _xmg_get_current_post_type_subtab(); 59 _xmg_single_posts_field(); 114 60 } 115 61 116 function _xmg_posts_type_field( ) { 117 118 $options_pt = _xmg_get_included_pt(); 119 $priority = get_option( 'priority_value' ); 120 $changefreq = get_option( 'changefreq_value' ); 121 $hide_posts = get_option( 'hide_post' ); 122 $remove_post_types = get_option( 'useless_posts' ); 123 $post_types = get_post_types(); 124 125 foreach ($remove_post_types as $remove_post_type) { 126 127 if (($key = array_search($remove_post_type, $post_types)) !== false) { 128 129 unset($post_types[$key]); 130 131 } 132 133 } 134 135 ?> 136 <?php if($options_pt){ ?> 137 <div class="table-responsive-vertical shadow-z-1"> 138 <table id="table" class="table table-hover table-striped"> 139 <thead> 140 <tr> 141 <th><?php _e('Visible in sitemap','xml-multilanguage-sitemap-generator'); ?></th> 142 <th><?php _e('Post type name','xml-multilanguage-sitemap-generator'); ?></th> 143 <th><?php _e('General Priority','xml-multilanguage-sitemap-generator'); ?></th> 144 <th><?php _e('General Changefreq','xml-multilanguage-sitemap-generator'); ?></th> 145 </tr> 146 </thead> 147 <tbody> <?php 148 foreach ($post_types as $post_type) { ?> 149 150 <tr> 151 <td data-title="Visible in sitemap"><input id="post_type_to_include_'<?php echo $post_type; ?>'" type='checkbox' name='post_type_to_include[<?php echo $post_type; ?>]' <?php if(isset($options_pt[$post_type])){checked( $options_pt[$post_type], 1 );} ?> value='1'><label for="post_type_to_include_'<?php echo $post_type; ?>'"></label></td> 152 153 <td data-title="Post type name"><?php echo $post_type; ?></td> 154 155 <td data-title="General Priority"><input type='number' step="0.1" min="0" max="1" name='priority_value[<?php echo $post_type; ?>]' value="<?php echo $priority[$post_type]; ?>"></td> 156 157 <td data-title="General Changefreq"><input class="autocomplete" type="text" name="changefreq_value[<?php echo $post_type ?>]" value="<?php echo $changefreq[$post_type]; ?>"></td> 158 159 </tr> 160 <?php } 161 162 ?> 163 164 </tbody> 165 166 </table> 167 168 </div> 169 170 <input type="submit" name="submit" class="button button-primary" value="<?php _e('Create the Sitemap','xml-multilanguage-sitemap-generator'); ?>"> 171 <?php 172 173 174 175 } else { ?> 176 <div class="table-responsive-vertical shadow-z-1 what"> 177 <table id="table" class="table table-hover table-striped"> 178 <thead> 179 <tr> 180 <th><?php _e('Visible in sitemap','xml-multilanguage-sitemap-generator'); ?></th> 181 <th><?php _e('Post type name','xml-multilanguage-sitemap-generator'); ?></th> 182 <th><?php _e('General Priority','xml-multilanguage-sitemap-generator'); ?></th> 183 <th><?php _e('General Changefreq','xml-multilanguage-sitemap-generator'); ?></th> 184 </tr> 185 </thead> 186 <tbody> <?php 187 188 foreach ($post_types as $post_type) { ?> 189 190 <tr> 191 <td data-title="Visible in sitemap"><input type='checkbox' id="post_type_to_include_'<?php echo $post_type; ?>'" name='post_type_to_include[<?php echo $post_type; ?>]' value='1'><label for="post_type_to_include_'<?php echo $post_type; ?>'"></label></td> 192 <td data-title="Post type name"><?php echo $post_type; ?></td> 193 <td data-title="General Priority"><input type='number' step="0.1" min="0" max="1" name='priority_value[<?php echo $post_type; ?>]' value="<?php echo $priority[$post_type]; ?>"></td> 194 <td data-title="General Changefreq"><input class="autocomplete" type="text" name="changefreq_value[<?php echo $post_type ?>]" value="<?php echo $changefreq[$post_type]; ?>"></td> 195 </tr> 196 <?php 197 } 198 ?> 199 </tbody> 200 201 </table> 202 203 </div> 204 205 <input type="submit" name="submit" class="button button-primary" value="<?php _e('Create the Sitemap','xml-multilanguage-sitemap-generator'); ?>"> 206 207 <?php 208 209 } 210 62 function _xmg_build_aside_options() { 63 _xmg_credits(); 64 _xmg_debug_column(); 65 _xmg_activate_license(); 211 66 } 212 213 function _xmg_single_posts_field( ) {214 215 $post_types_chosen = _xmg_get_included_pt();216 $options_id = _xmg_get_excluded_id();217 $priority = get_option('priority_value');218 $priority_single_value = get_option('priority_single_value');219 $changefreq = get_option('changefreq_value');220 $changefreq_single_value = get_option('changefreq_single_value');221 222 if($post_types_chosen){223 foreach ($post_types_chosen as $post_type_chosen => $value) {224 225 $post_type_name = get_post_type_object( $post_type_chosen )->labels->singular_name;226 $args = array(227 'post_type' => $post_type_chosen,228 'posts_per_page' => -1,229 );230 231 // The Query232 $query = new WP_Query( $args );233 234 235 236 // The Loop237 if ( $query->have_posts() ) { ?>238 <div class="xmg_section">239 <div class="xmg_section_title">240 <p style="text-transform: capitalize;"><?php echo $post_type_name; ?></p>241 </div>242 <div class="xmg_section_content">243 <div class="table-responsive-vertical shadow-z-1">244 <table id="table" class="table table-hover table-striped">245 <thead>246 <tr>247 <th><?php _e('Hide','xml-multilanguage-sitemap-generator'); ?></th>248 <th><?php _e('ID','xml-multilanguage-sitemap-generator'); ?></th>249 <th><?php _e('Title','xml-multilanguage-sitemap-generator'); ?></th>250 <th><?php _e('Priority','xml-multilanguage-sitemap-generator'); ?></th>251 <th><?php _e('Changefreq','xml-multilanguage-sitemap-generator'); ?></th>252 </tr>253 </thead>254 <tbody>255 <?php256 while ( $query->have_posts() ) {257 $query->the_post();258 $id = get_the_ID();259 $title = get_the_title();260 $permalink = get_permalink();261 262 if($options_id){ ?>263 <tr>264 <td data-title="Hide"><input id="id_excluded[<?php echo $id; ?>]" type='checkbox' name='id_excluded[<?php echo $id; ?>]' <?php if(isset($options_id[$id])){ checked( $options_id[$id], 1 ); } ?> value='1'><label for='id_excluded[<?php echo $id; ?>]'></label></td>265 <td data-title="ID"><?php echo $id; ?></td>266 <td data-title="Title"><a target="_blank" href="<?php echo $permalink; ?>"><?php echo $title; ?></a></td>267 268 <?php if($priority_single_value[$id]){ ?>269 270 <td data-title="Priority"><input type='number' step="0.1" min="0" max="1" name='priority_single_value[<?php echo $id; ?>]' value="<?php echo $priority_single_value[$id]; ?>"></td>271 272 <?php } else { ?>273 274 <td data-title="Priority"><input type='number' step="0.1" min="0" max="1" name='priority_single_value[<?php echo $id; ?>]' placeholder="<?php echo $priority[get_post_type()]; ?>"></td>275 276 <?php } ?>277 <?php if($changefreq_single_value[$id]){ ?>278 279 <td data-title="Changefreq"><input class="autocomplete" type='text' name='changefreq_single_value[<?php echo $id; ?>]' value="<?php echo $changefreq_single_value[$id]; ?>"></td>280 281 <?php } else { ?>282 283 <td data-title="Changefreq"><input class="autocomplete" type='text' name='changefreq_single_value[<?php echo $id; ?>]' placeholder="<?php echo $changefreq[get_post_type()]; ?>"></td>284 <?php } ?>285 </tr>286 287 <?php } else { ?>288 <tr>289 <td data-title="Hide"><input id="id_excluded[<?php echo $id; ?>]" type='checkbox' name='id_excluded[<?php echo $id; ?>]' value='1'><label for='id_excluded[<?php echo $id; ?>]'></label></td>290 <td data-title="ID"><?php echo $id; ?></td>291 <td data-title="Title"><a target="_blank" href="<?php echo $permalink; ?>"><?php echo $title; ?></a></td>292 293 <?php if(isset($priority_single_value[$id]) && $priority_single_value[$id]){ ?>294 <td data-title="Priority"><input type='number' step="0.1" min="0" max="1" name='priority_single_value[<?php echo $id; ?>]' value="<?php echo $priority_single_value[$id]; ?>"></td>295 296 <?php } else { ?>297 298 <td data-title="Priority"><input type='number' step="0.1" min="0" max="1" name='priority_single_value[<?php echo $id; ?>]' placeholder="<?php echo $priority[get_post_type()]; ?>"></td>299 300 <?php } ?>301 <?php if(isset($changefreq_single_value[$id]) && $changefreq_single_value[$id]){ ?>302 303 <td data-title="Changefreq"><input class="autocomplete" type='text' name='changefreq_single_value[<?php echo $id; ?>]' value="<?php echo $changefreq_single_value[$id]; ?>"></td>304 305 <?php } else { ?>306 307 <td data-title="Changefreq"><input class="autocomplete" type='text' name='changefreq_single_value[<?php echo $id; ?>]' placeholder="<?php echo $changefreq[get_post_type()]; ?>"></td>308 <?php } ?>309 </tr>310 311 <?php312 313 }314 315 } ?>316 317 </tbody>318 319 </table>320 321 </div>322 <input type="submit" name="submit" class="button button-primary" value="<?php _e('Create the Sitemap','xml-multilanguage-sitemap-generator'); ?>">323 </div>324 </div>325 <?php326 }327 328 // Restore original Post Data329 wp_reset_postdata();330 331 }332 }333 }334 335 336 /*337 *338 * Debug Infos339 *340 */341 function _xmg_debug_column() { ?>342 <?php343 if ( is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' ) ) {344 $active_plugin = 'Sitepress';345 $languages_obj = icl_get_languages('skip_missing=0');346 foreach ($languages_obj as $language_obj) {347 $lang_code = $language_obj['language_code'];348 if(in_array( $lang_code, apply_filters( 'wpml_setting', array(), 'hidden_languages' ) )){349 unset($languages_obj[$lang_code]);350 }351 }352 foreach ($languages_obj as $language_obj) {353 $languages[] = $language_obj['language_code'];354 }355 } elseif (is_plugin_active( 'polylang/polylang.php' )) {356 $active_plugin = 'Polylang';357 $languages = pll_languages_list();358 } else {359 $active_plugin = 'No multilanguage plugin';360 $languages = false;361 }362 if(is_array($languages) && !empty($languages)){363 $languages = implode(',', $languages);364 }?>365 <div class="xmg_section_title"><p>Debugger</p></div>366 <div class="debugger">367 <ul>368 <li><b>WordPress info</b></li>369 <li>Versione di WordPress: <u><?php echo get_bloginfo( 'version' ); ?></u></li>370 <li>Dominio: <u><?php echo get_site_url(); ?></u></li>371 <li><b>Premium info</b></li>372 <li>Premium status: <u><?php echo _xmg_check_license(); ?></u></li>373 <li>Premium key: <u><?php echo get_option('xml_gen_premium_license_key'); ?></u></li>374 <li><b>Multilanguage info</b></li>375 <li>Plugin attivi: <u><?php print_r($active_plugin); ?></u></li>376 <li>Lingue attive: <u><?php print_r($languages); ?></u></li>377 </ul>378 </div>379 380 <?php }381 382 function _xmg_credits(){ ?>383 <div class="xmg_section_title">384 <h3 style="margin: 0">XML MULTILANGUAGE SITEMAP GENERATOR</h3>385 </div>386 <div class="xmg_section_content">387 <p><?php _e("Hi, i'm Marco! Nice to meet you. I've made this plugin for help every site owner to manage his multisite sitemap. I hope it will help you. ","xml-multilanguage-sitemap-generator") ?></p>388 <p><?php _e("If yes, please consider leave a vote on WordPress clickin on the stars below or offer me a coffee clicking on this <a target='_blank' href='https://www.paypal.me/gianemi2'>PayPal link</a>.") ?></p>389 <p><?php _e("I'm proud that you're onboard!", 'xml-multilanguage-sitemap-generator'); ?></p>390 <a class="vote-me" href="https://wordpress.org/plugins/xml-multilanguage-sitemap-generator/" target="_blank"><p><b><?php _e('Vote me on WordPress', 'xml-multilanguage-sitemap-generator'); ?> </b><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span></p></a>391 <h4><?php _e("Useful links:") ?></h4>392 <p><a href="https://wordpress.org/plugins/xml-multilanguage-sitemap-generator/#faq" target="_blank">FAQ</a></p>393 <p><a href="https://wordpress.org/support/plugin/xml-multilanguage-sitemap-generator" target="_blank"><?php _e('Support', 'xml-multilanguage-sitemap-generator'); ?></a></p>394 <p><a href="mailto:[email protected]"><?php _e('Send me a mail (use sparingly)', 'xml-multilanguage-sitemap-generator'); ?></a></p>395 </div>396 <div class="xmg_section_footer">397 <?php _e('Made with <span class="dashicons dashicons-heart red"></span> in Italy.', 'xml-multilanguage-sitemap-generator'); ?>398 </div>399 <?php }400 67 401 68 /* … … 407 74 <div class="xmg_config_settings"> 408 75 <div class="plugin-settings-page"> 409 <div class="xmg_section"> 410 <div> 411 <h2>XML Multilanguage Sitemap Generator</h2> 412 </div> 413 </div> 76 <h1>XML Multilanguage Sitemap Generator</h1> 77 <p><?php _e('Welcome in configuration panel.', 'xml-multilanguage-sitemap-generator'); ?></p> 78 <?php 79 $active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'general'; 80 ?> 81 <h2 class="nav-tab-wrapper"> 82 <a href="?page=xml_multilanguage_sitemap_generator&tab=general" class="nav-tab <?php echo $active_tab == 'general' ? 'nav-tab-active' : ''; ?>"> 83 <?php _e('General Options', 'xml-multilanguage-sitemap-generator'); ?> 84 </a> 85 <a href="?page=xml_multilanguage_sitemap_generator&tab=post_type" class="nav-tab <?php echo $active_tab == 'post_type' ? 'nav-tab-active' : ''; ?>"> 86 <?php _e('Post Type Options', 'xml-multilanguage-sitemap-generator'); ?> 87 </a> 88 </h2> 414 89 <form action="options.php" method='post'> 415 <input type="hidden" name="option_page" value="_xmg_configurator_page"> 416 <input type="hidden" name="action" value="update"> 417 <?php settings_fields( '_xmg_configurator_page' ); ?> 418 <input type="hidden" name="tutorial_status" value="true"> 419 <div class="xmg_section"> 420 <div class="xmg_section_title"> 421 <p><?php _e('Choose the sitemap name', 'xml-multilanguage-sitemap-generator'); ?></p> 422 </div> 423 <div class="xmg_section_content"> 424 <?php _xmg_sitemap_name_field(); ?> 425 </div> 426 </div> 427 <div class="xmg_section postbox"> 428 <div class="xmg_section_title"> 429 <p><?php _e('Choose the post type to show inside sitemap.') ?></p> 430 </div> 431 <div class="xmg_section_content"> 432 <?php _xmg_posts_type_field(); ?> 433 </div> 434 </div> 435 <?php if(_xmg_get_included_pt()) : 436 _xmg_single_posts_field(); 437 endif; ?> 90 <?php switch ($active_tab) { 91 case 'general': 92 settings_fields( '_xmg_configurator_page_general' ); 93 _xmg_build_general_options(); 94 break; 95 case 'post_type': 96 settings_fields( '_xmg_configurator_page_post_type' ); 97 _xmg_build_post_type_options(); 98 break; 99 default: 100 _xmg_build_general_options(); 101 break; 102 } ?> 438 103 </form> 439 104 </div> 440 105 441 <div class="sponsor-sidebar"> 442 <div class="sponsor xmg_section"> 443 <?php _xmg_credits(); ?> 444 </div> 445 <?php if(get_option('is_debug')){ ?> 446 <div class="sponsor xmg_section"> 447 <?php _xmg_debug_column(); ?> 448 </div> 449 <?php } ?> 450 <!-- <div class="sponsor xmg_section"> 451 <?php //_xmg_activate_license(); ?> 452 </div> --> 453 <?php if(_xmg_check_license()) : ?> 454 <div class="sponsor xmg_section"> 455 <?php _xmg_scan_root(); ?> 456 </div> 457 <?php endif; ?> 106 <div class="sponsor-sidebar"> 107 <?php _xmg_build_aside_options(); ?> 458 108 </div> 459 109 </div> -
xml-multilanguage-sitemap-generator/trunk/includes/premium/define-premium.php
r1854013 r1859765 25 25 26 26 function _xmg_activate_license() { 27 exit; 28 echo '<div class="sponsor xmg_section">'; 29 if (isset($_REQUEST['activate_license'])) { 30 31 $license_key = $_REQUEST['xml_gen_premium_license_key']; 27 32 28 if (isset($_REQUEST['activate_license'])) { 29 30 $license_key = $_REQUEST['xml_gen_premium_license_key']; 33 // API query parameters 34 $api_params = array( 35 'slm_action' => 'slm_activate', 36 'secret_key' => XML_GEN_SECRET_KEY, 37 'license_key' => $license_key, 38 'registered_domain' => $_SERVER['SERVER_NAME'], 39 'item_reference' => urlencode(XML_GEN_ITEM_REFERENCE), 40 ); 31 41 32 // API query parameters 33 $api_params = array( 34 'slm_action' => 'slm_activate', 35 'secret_key' => XML_GEN_SECRET_KEY, 36 'license_key' => $license_key, 37 'registered_domain' => $_SERVER['SERVER_NAME'], 38 'item_reference' => urlencode(XML_GEN_ITEM_REFERENCE), 39 ); 42 // Send query to the license manager server 43 $query = esc_url_raw(add_query_arg($api_params, XML_GEN_SERVER_URL)); 44 $response = wp_remote_get($query, array('timeout' => 20, 'sslverify' => false)); 40 45 41 // Send query to the license manager server 42 $query = esc_url_raw(add_query_arg($api_params, XML_GEN_SERVER_URL)); 43 $response = wp_remote_get($query, array('timeout' => 20, 'sslverify' => false)); 46 // Check for error in the response 47 if (is_wp_error($response)){ 48 echo "Unexpected Error! The query returned with an error."; 49 } 44 50 45 // Check for error in the response 46 if (is_wp_error($response)){ 47 echo "Unexpected Error! The query returned with an error."; 51 //var_dump($response);//uncomment it if you want to look at the full response 52 53 // License data. 54 $license_data = json_decode(wp_remote_retrieve_body($response)); 55 56 // TODO - Do something with it. 57 //var_dump($license_data);//uncomment it to look at the data 58 59 if($license_data->result == 'success'){//Success was returned for the license activation 60 61 //Uncomment the followng line to see the message that returned from the license server 62 echo '<div class="notice notice-success"><p>'.__('The license Key has been activated. Thank you for your choice!','xml-multilanguage-sitemap-generator').'</p></div>'; 63 64 //Save the license key in the options table 65 update_option('xml_gen_premium_license_key', $license_key); 66 } 67 else{ 68 //Show error to the user. Probably entered incorrect license key. 69 70 //Uncomment the followng line to see the message that returned from the license server 71 echo '<div class="notice notice-error"><p>'.__("I'm sorry but there's an error with the key. Probably you are trying to write a wrong key.","xml-multilanguage-sitemap-generator").'</p></div>'; 72 } 73 48 74 } 75 /*** End of license activation ***/ 49 76 50 //var_dump($response);//uncomment it if you want to look at the full response 51 52 // License data. 53 $license_data = json_decode(wp_remote_retrieve_body($response)); 54 55 // TODO - Do something with it. 56 //var_dump($license_data);//uncomment it to look at the data 57 58 if($license_data->result == 'success'){//Success was returned for the license activation 77 /*** License activate button was clicked ***/ 78 if (isset($_REQUEST['deactivate_license'])) { 79 $license_key = $_REQUEST['xml_gen_premium_license_key']; 80 81 // API query parameters 82 $api_params = array( 83 'slm_action' => 'slm_deactivate', 84 'secret_key' => XML_GEN_SECRET_KEY, 85 'license_key' => $license_key, 86 'registered_domain' => $_SERVER['SERVER_NAME'], 87 'item_reference' => urlencode(XML_GEN_ITEM_REFERENCE), 88 ); 89 90 // Send query to the license manager server 91 $query = esc_url_raw(add_query_arg($api_params, XML_GEN_SERVER_URL)); 92 $response = wp_remote_get($query, array('timeout' => 20, 'sslverify' => false)); 93 94 // Check for error in the response 95 if (is_wp_error($response)){ 96 echo "Unexpected Error! The query returned with an error."; 97 } 98 99 //var_dump($response);//uncomment it if you want to look at the full response 59 100 60 // Uncomment the followng line to see the message that returned from the license server61 echo '<div class="notice notice-success"><p>'.__('The license Key has been activated. Thank you for your choice!','xml-multilanguage-sitemap-generator').'</p></div>';101 // License data. 102 $license_data = json_decode(wp_remote_retrieve_body($response)); 62 103 63 //Save the license key in the options table 64 update_option('xml_gen_premium_license_key', $license_key); 104 // TODO - Do something with it. 105 //var_dump($license_data);//uncomment it to look at the data 106 107 if($license_data->result == 'success'){//Success was returned for the license activation 108 109 //Uncomment the followng line to see the message that returned from the license server 110 echo '<div class="notice notice-success"><p>'.__("The license key has been removed correctly.","xml-multilanguage-sitemap-generator").'</p></div>'; 111 112 //Remove the licensse key from the options table. It will need to be activated again. 113 update_option('xml_gen_premium_license_key', ''); 114 } 115 else{ 116 //Show error to the user. Probably entered incorrect license key. 117 118 //Uncomment the followng line to see the message that returned from the license server 119 echo '<div class="notice notice-error"><p>'.__("The license key on this domain is already inactive.","xml-multilanguage-sitemap-generator").'</p></div>'; 120 } 121 65 122 } 66 else{ 67 //Show error to the user. Probably entered incorrect license key. 68 69 //Uncomment the followng line to see the message that returned from the license server 70 echo '<div class="notice notice-error"><p>'.__("I'm sorry but there's an error with the key. Probably you are trying to write a wrong key.","xml-multilanguage-sitemap-generator").'</p></div>'; 71 } 123 /*** End of sample license deactivation ***/ 124 ?> 125 <div class="xmg_section_title"> 126 <?php if(!_xmg_check_license()) : ?> 127 <p><?php _e('Become Premium ','xml-multilanguage-sitemap-generator'); ?><span style="color: #FFBF45;" class="dashicons dashicons-star-empty"></span></p> 128 <?php else : ?> 129 <p><?php _e('Premium user ','xml-multilanguage-sitemap-generator'); ?><span style="color: #FFBF45;" class="dashicons dashicons-star-filled"></span></p> 130 <?php endif; ?></p> 131 </div> 132 <div class="activation-form"> 133 <form action="" method="post"> 134 <?php wp_create_nonce('_xmg_premium_license'); ?> 135 <?php wp_nonce_field('_xmg_premium_license'); ?> 136 <input placeholder="<?php _e('Insert your license key', 'xml-multilanguage-sitemap-generator'); ?>" class="input-with-btn" type="text" id="xml_gen_premium_license_key" name="xml_gen_premium_license_key" value="<?php echo get_option('xml_gen_premium_license_key'); ?>" > 137 <?php if(!_xmg_check_license()) : ?> 138 <input type="submit" name="activate_license" value="<?php _e('Activate', 'xml-multilanguage-sitemap-generator'); ?>" class="button-primary" /> 139 <?php else : ?> 140 <input type="submit" name="deactivate_license" value="<?php _e('Deactivate', 'xml-multilanguage-sitemap-generator'); ?>" class="button" /> 141 <?php endif; ?> 142 </form> 143 <?php if(!_xmg_check_license()) : ?> 144 <p class="no-margin clear"><a target="_blank" href="https://marcogiannini.net">Passa alla versione premium per funzioni esclusive!</a></p> 145 <?php endif; ?> 146 </div> 147 </div><?php 72 148 73 }74 /*** End of license activation ***/75 76 /*** License activate button was clicked ***/77 if (isset($_REQUEST['deactivate_license'])) {78 $license_key = $_REQUEST['xml_gen_premium_license_key'];79 80 // API query parameters81 $api_params = array(82 'slm_action' => 'slm_deactivate',83 'secret_key' => XML_GEN_SECRET_KEY,84 'license_key' => $license_key,85 'registered_domain' => $_SERVER['SERVER_NAME'],86 'item_reference' => urlencode(XML_GEN_ITEM_REFERENCE),87 );88 89 // Send query to the license manager server90 $query = esc_url_raw(add_query_arg($api_params, XML_GEN_SERVER_URL));91 $response = wp_remote_get($query, array('timeout' => 20, 'sslverify' => false));92 93 // Check for error in the response94 if (is_wp_error($response)){95 echo "Unexpected Error! The query returned with an error.";96 }97 98 //var_dump($response);//uncomment it if you want to look at the full response99 100 // License data.101 $license_data = json_decode(wp_remote_retrieve_body($response));102 103 // TODO - Do something with it.104 //var_dump($license_data);//uncomment it to look at the data105 106 if($license_data->result == 'success'){//Success was returned for the license activation107 108 //Uncomment the followng line to see the message that returned from the license server109 echo '<div class="notice notice-success"><p>'.__("The license key has been removed correctly.","xml-multilanguage-sitemap-generator").'</p></div>';110 111 //Remove the licensse key from the options table. It will need to be activated again.112 update_option('xml_gen_premium_license_key', '');113 }114 else{115 //Show error to the user. Probably entered incorrect license key.116 117 //Uncomment the followng line to see the message that returned from the license server118 echo '<div class="notice notice-error"><p>'.__("The license key on this domain is already inactive.","xml-multilanguage-sitemap-generator").'</p></div>';119 }120 121 }122 /*** End of sample license deactivation ***/123 ?>124 <div class="xmg_section_title">125 <?php if(!_xmg_check_license()) : ?>126 <p><?php _e('Become Premium ','xml-multilanguage-sitemap-generator'); ?><span style="color: #FFBF45;" class="dashicons dashicons-star-empty"></span>127 <?php else : ?>128 <p><?php _e('Premium user ','xml-multilanguage-sitemap-generator'); ?><span style="color: #FFBF45;" class="dashicons dashicons-star-filled"></span>129 <?php endif; ?></p>130 </div>131 <div class="activation-form">132 <form action="" method="post">133 <?php wp_create_nonce('_xmg_premium_license'); ?>134 <?php wp_nonce_field('_xmg_premium_license'); ?>135 <input placeholder="<?php _e('Insert your license key', 'xml-multilanguage-sitemap-generator'); ?>" class="input-with-btn" type="text" id="xml_gen_premium_license_key" name="xml_gen_premium_license_key" value="<?php echo get_option('xml_gen_premium_license_key'); ?>" >136 <?php if(!_xmg_check_license()) : ?>137 <input type="submit" name="activate_license" value="<?php _e('Activate', 'xml-multilanguage-sitemap-generator'); ?>" class="button-primary" />138 <?php else : ?>139 <input type="submit" name="deactivate_license" value="<?php _e('Deactivate', 'xml-multilanguage-sitemap-generator'); ?>" class="button" />140 <?php endif; ?>141 </form>142 <?php if(!_xmg_check_license()) : ?>143 <p class="no-margin clear"><a target="_blank" href="https://marcogiannini.net">Passa alla versione premium per funzioni esclusive!</a></p>144 <?php endif; ?>145 </div> <?php146 149 147 150 } -
xml-multilanguage-sitemap-generator/trunk/includes/premium/delete_xml.php
r1854013 r1859765 3 3 function _xmg_scan_root(){ 4 4 5 echo '<div class=" xmg_section_title"><p>Sitemap remover</p></div>';5 echo '<div class="sponsor xmg_section"><div class="xmg_section_title"><p>Sitemap remover</p></div>'; 6 6 7 7 if(_xmg_check_license()){ … … 67 67 <thead> 68 68 <tr> 69 <th><?php _e(' Nome Sitemap','xml-multilanguage-sitemap-generator'); ?></th>70 <th><?php _e(' Cancella Sitemap','xml-multilanguage-sitemap-generator'); ?></th>69 <th><?php _e('Sitemap name','xml-multilanguage-sitemap-generator'); ?></th> 70 <th><?php _e('Delete sitemap','xml-multilanguage-sitemap-generator'); ?></th> 71 71 </tr> 72 72 </thead> … … 106 106 } 107 107 108 echo '</div>'; 109 108 110 }
Note: See TracChangeset
for help on using the changeset viewer.