Changeset 3404041
- Timestamp:
- 11/27/2025 12:02:55 PM (4 months ago)
- Location:
- alternative-site-settings
- Files:
-
- 93 added
- 11 edited
-
assets/banner-1544x500.png (modified) (previous)
-
assets/banner-772x250.png (modified) (previous)
-
assets/icon-128x128.png (modified) (previous)
-
assets/icon-256x256.png (modified) (previous)
-
tags/1.2.2 (added)
-
tags/1.2.2/admin (added)
-
tags/1.2.2/admin/css (added)
-
tags/1.2.2/admin/css/alt-site-settings-style.css (added)
-
tags/1.2.2/admin/css/custom_controls.css (added)
-
tags/1.2.2/admin/css/for-theme (added)
-
tags/1.2.2/admin/css/for-theme/cf-style.css (added)
-
tags/1.2.2/admin/css/for-theme/cookie-banner.css (added)
-
tags/1.2.2/admin/css/for-theme/footer-section.css (added)
-
tags/1.2.2/admin/css/for-theme/reviews-style.css (added)
-
tags/1.2.2/admin/images (added)
-
tags/1.2.2/admin/images/ass-icon_512x.png (added)
-
tags/1.2.2/admin/images/ass-logo_90x90.png (added)
-
tags/1.2.2/admin/images/for-theme (added)
-
tags/1.2.2/admin/images/for-theme/star-empty.svg (added)
-
tags/1.2.2/admin/images/for-theme/star-error.svg (added)
-
tags/1.2.2/admin/images/for-theme/star-full.svg (added)
-
tags/1.2.2/admin/images/loading.gif (added)
-
tags/1.2.2/admin/images/menu-icon.svg (added)
-
tags/1.2.2/admin/images/no-img.jpg (added)
-
tags/1.2.2/admin/images/nophoto.jpg (added)
-
tags/1.2.2/admin/images/spinner-2x.gif (added)
-
tags/1.2.2/admin/images/spinner.gif (added)
-
tags/1.2.2/admin/images/uploader-icons-2x.png (added)
-
tags/1.2.2/admin/images/uploader-icons.png (added)
-
tags/1.2.2/admin/js (added)
-
tags/1.2.2/admin/js/cforms.js (added)
-
tags/1.2.2/admin/js/fields-sortable-script.js (added)
-
tags/1.2.2/admin/js/for-theme (added)
-
tags/1.2.2/admin/js/for-theme/cf-script.js (added)
-
tags/1.2.2/admin/js/for-theme/cookie-banner.js (added)
-
tags/1.2.2/admin/js/for-theme/reviews-form.js (added)
-
tags/1.2.2/admin/js/ge-metaboxes.js (added)
-
tags/1.2.2/admin/js/img-uploader.js (added)
-
tags/1.2.2/admin/js/reviews-script.js (added)
-
tags/1.2.2/admin/js/settings-script.js (added)
-
tags/1.2.2/admin/js/specialized-settings-script.js (added)
-
tags/1.2.2/altss.php (added)
-
tags/1.2.2/classes (added)
-
tags/1.2.2/classes/class.Disable_ALL_Comments.php (added)
-
tags/1.2.2/classes/class.Installer.php (added)
-
tags/1.2.2/classes/class.Post_Duplicator.php (added)
-
tags/1.2.2/classes/class.Reviews_List_Table.php (added)
-
tags/1.2.2/includes (added)
-
tags/1.2.2/includes/admin-menu.php (added)
-
tags/1.2.2/includes/admin-plugin-functions.php (added)
-
tags/1.2.2/includes/altss-svg-icon-to-base64.php (added)
-
tags/1.2.2/includes/cforms-settings-page.php (added)
-
tags/1.2.2/includes/custom-types-register.php (added)
-
tags/1.2.2/includes/data-vars (added)
-
tags/1.2.2/includes/data-vars/cform-field-keys.php (added)
-
tags/1.2.2/includes/data-vars/cform-fields.php (added)
-
tags/1.2.2/includes/data-vars/cookie-banner-data.php (added)
-
tags/1.2.2/includes/data-vars/custom-type-vars.php (added)
-
tags/1.2.2/includes/data-vars/whitelist-of-bots.php (added)
-
tags/1.2.2/includes/frontend (added)
-
tags/1.2.2/includes/frontend/classes (added)
-
tags/1.2.2/includes/frontend/classes/class-collapse-adminbar.php (added)
-
tags/1.2.2/includes/frontend/classes/class-cookie-banner.php (added)
-
tags/1.2.2/includes/frontend/frontend-ajax-functions.php (added)
-
tags/1.2.2/includes/frontend/frontend-analytics-scripts.php (added)
-
tags/1.2.2/includes/frontend/frontend-form-set-functions.php (added)
-
tags/1.2.2/includes/frontend/frontend-functions.php (added)
-
tags/1.2.2/includes/frontend/frontend-head-functions.php (added)
-
tags/1.2.2/includes/frontend/frontend-tag-functions.php (added)
-
tags/1.2.2/includes/plugin-media-functions.php (added)
-
tags/1.2.2/includes/post-metaboxes.php (added)
-
tags/1.2.2/includes/reviews-page.php (added)
-
tags/1.2.2/includes/special-page.php (added)
-
tags/1.2.2/includes/start-page.php (added)
-
tags/1.2.2/includes/sub-includes (added)
-
tags/1.2.2/includes/sub-includes/cforms-settings-tab-0.php (added)
-
tags/1.2.2/includes/sub-includes/cforms-settings-tab-1.php (added)
-
tags/1.2.2/includes/sub-includes/cforms-settings-tab-2.php (added)
-
tags/1.2.2/includes/sub-includes/cforms-settings-tab-3.php (added)
-
tags/1.2.2/includes/sub-includes/start-page-tab-0.php (added)
-
tags/1.2.2/includes/sub-includes/start-page-tab-1.php (added)
-
tags/1.2.2/includes/sub-includes/start-page-tab-2.php (added)
-
tags/1.2.2/includes/sub-includes/start-page-tab-3.php (added)
-
tags/1.2.2/languages (added)
-
tags/1.2.2/languages/altss-ru_RU.mo (added)
-
tags/1.2.2/languages/altss-ru_RU.po (added)
-
tags/1.2.2/languages/js (added)
-
tags/1.2.2/languages/js/altss-ru_RU-2391f0cc9d5d3c1e41a045b91fa8e74f.json (added)
-
tags/1.2.2/languages/js/altss-ru_RU-36c5f34aaa81b417a81e83b48cd31d0c.json (added)
-
tags/1.2.2/languages/js/altss-ru_RU-42ad9281dd137e41da22c7226d8346ce.json (added)
-
tags/1.2.2/languages/js/altss-ru_RU-866ceec6942bcfecf0741231521e07cc.json (added)
-
tags/1.2.2/languages/js/altss-ru_RU-f09992f9a998d66c14a37ea49ab91a69.json (added)
-
tags/1.2.2/languages/js/altss-ru_RU.po (added)
-
tags/1.2.2/license.txt (added)
-
tags/1.2.2/readme.txt (added)
-
tags/1.2.2/uninstall.php (added)
-
trunk/admin/css/alt-site-settings-style.css (modified) (1 diff)
-
trunk/admin/js/ge-metaboxes.js (added)
-
trunk/altss.php (modified) (1 diff)
-
trunk/includes/frontend/frontend-head-functions.php (modified) (4 diffs)
-
trunk/includes/post-metaboxes.php (modified) (5 diffs)
-
trunk/languages/altss-ru_RU.mo (modified) (previous)
-
trunk/languages/altss-ru_RU.po (modified) (3 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
alternative-site-settings/trunk/admin/css/alt-site-settings-style.css
r3382038 r3404041 231 231 max-width: 600px; 232 232 } 233 234 .ge-seo-meta-panel { 235 background-color: #f9f9f9; 236 } 237 233 238 .options-analytics dl dd input[type=checkbox]:checked::before { 234 239 width: 1.5rem; -
alternative-site-settings/trunk/altss.php
r3397897 r3404041 5 5 * Plugin URI: https://github.com/tmutstudio/alternative-site-settings 6 6 * Description: Plugin for managing site settings, including feedback forms, photo gallery, reviews and contacts. 7 * Version: 1.2. 17 * Version: 1.2.2 8 8 * Author: tmutarakan-dev 9 9 * Author URI: https://github.com/tmutstudio -
alternative-site-settings/trunk/includes/frontend/frontend-head-functions.php
r3397897 r3404041 5 5 6 6 function altss_modify_document_title( $title ) { 7 7 8 if( empty( altss_get_settings_set( 'seo_meta_enabled' ) ) ) { 8 9 return $title; … … 15 16 else if ( is_singular() ) { 16 17 $post = get_queried_object(); 17 $meta_title = get_post_meta( $post->ID, 'seo_meta_title', true ); 18 return '' != $meta_title ? $meta_title : $title; 18 19 $title_value = get_post_meta( $post->ID, '_seo_meta_title', true ); 20 $title_value_depr = get_post_meta( $post->ID, 'seo_meta_title', true ); 21 22 $meta_title = empty( $title_value_depr ) ? $title_value ?? '' : $title_value_depr; 23 24 return ! empty( $meta_title ) ? $meta_title : $title; 19 25 } 20 26 else if ( is_category() || is_tax() ) { … … 46 52 47 53 if( is_singular() && !is_front_page() ) { 48 $meta_ogimage = get_post_meta( $post->ID, 'seo_meta_og_image', true ); 49 if( $meta_ogimage || has_post_thumbnail($post->ID) ) { 50 if( $meta_ogimage ) { 54 $description_value = get_post_meta( $post->ID, '_seo_meta_description', true ); 55 $description_value_depr = get_post_meta( $post->ID, 'seo_meta_description', true ); 56 $og_image_value = get_post_meta( $post->ID, '_seo_meta_og_image', true ); 57 $og_image_value_depr = get_post_meta( $post->ID, 'seo_meta_og_image', true ); 58 59 $meta_description = empty( $description_value_depr ) ? $description_value ?? '' : $description_value_depr; 60 $meta_ogimage = empty( $og_image_value_depr ) ? $og_image_value ?? '' : $og_image_value_depr; 61 62 if( ! empty( $meta_ogimage ) || has_post_thumbnail($post->ID) ) { 63 if( ! empty( $meta_ogimage ) ) { 51 64 $ogimg = $meta_ogimage; 52 65 } … … 56 69 57 70 } 58 $meta_description = get_post_meta( $post->ID, 'seo_meta_description', true );59 71 $post_excerpt = wp_strip_all_tags( apply_filters( 'get_the_excerpt', $post->post_excerpt, $post ), true ); 60 $desc_value = $ogdesc = esc_attr( $meta_description ?: wp_strip_all_tags( $post_excerpt ) );72 $desc_value = $ogdesc = esc_attr( ! empty( $meta_description ) ? $meta_description : wp_strip_all_tags( $post_excerpt ) ); 61 73 } 62 74 elseif( is_archive() ){ -
alternative-site-settings/trunk/includes/post-metaboxes.php
r3382038 r3404041 1 1 <?php 2 2 if ( ! defined( 'ABSPATH' ) ) exit; 3 4 add_action('rest_api_init', function() { 5 global $post; 6 $type = $post->post_type; 7 register_post_meta( $type, '_seo_meta_title', [ 8 'show_in_rest' => true, 9 'single' => true, 10 'type' => 'string', 11 'auth_callback' => '__return_true' 12 ]); 13 14 register_post_meta( $type, '_seo_meta_description', [ 15 'show_in_rest' => true, 16 'single' => true, 17 'type' => 'string', 18 'auth_callback' => '__return_true' 19 ]); 20 21 register_post_meta( $type, '_seo_meta_og_image', [ 22 'show_in_rest' => true, 23 'single' => true, 24 'type' => 'string', 25 'auth_callback' => '__return_true' 26 ]); 27 28 29 } ); 30 3 31 4 32 add_action('add_meta_boxes', 'altss_extra_seo_metabox', 1); 5 33 6 34 function altss_extra_seo_metabox() { 35 global $altss_settings_options, $post, $wp_meta_keys; 36 $type = $post->post_type; 37 switch ( $type ) { 38 case 'page': 39 $meta_title = __( "Page title text", "altss" ); 40 break; 41 case 'post': 42 $meta_title = __( "Post title text", "altss" ); 43 break; 44 } 45 if( empty( $altss_settings_options['seo_meta_enabled'] ) ) { 46 return; 47 } 48 if ( function_exists( 'use_block_editor_for_post' ) && use_block_editor_for_post( $post ) ) { 49 wp_enqueue_script( 50 'altss-ge-metaboxes', 51 ALTSITESET_URL . '/admin/js/ge-metaboxes.js', 52 [ 53 'wp-plugins', 54 'wp-edit-post', 55 'wp-element', 56 'wp-components', 57 'wp-data', 58 'wp-block-editor', 59 'wp-i18n' 60 ], 61 ALTSITESET__VERSION 62 ); 63 wp_localize_script( 'altss-ge-metaboxes', 'geScriptData', 64 [ 65 'i18n_panel_title' => esc_html__( 'Data for SEO promotion', 'altss' ), 66 'i18n_title_label' => $meta_title, 67 'i18n_desc_label' => esc_html__( 'Article description', 'altss' ), 68 'i18n_ogimage_label' => esc_html__( 'og:image', 'altss' ), 69 'i18n_ogimage_res_label' => esc_html__( 'Optimal resolution 600x315 pixels', 'altss' ), 70 'i18n_replace_image_label' => esc_html__( 'Replace image', 'altss' ), 71 'i18n_select_image_label' => esc_html__( 'Select an image', 'altss' ), 72 'i18n_delete_image_label' => esc_html__( 'Delete', 'altss' ), 73 ] 74 ); 75 76 return; 77 } 78 79 add_filter( 'is_protected_meta', function( $protected, $meta_key ){ 80 $hide_meta_keys = array( 'footnotes' ); 81 if( in_array( $meta_key, $hide_meta_keys ) ){ 82 return true; 83 } 84 85 return $protected; 86 }, 10, 2 ); 87 88 7 89 add_meta_box( 8 90 'seo_meta_box', … … 13 95 'post', 14 96 'news', 15 ' actions',97 'promotions', 16 98 'books', 17 99 'docs', 18 100 'videos', 19 101 ], 20 'normal' 102 'normal', 103 'high', 104 [ 105 '__back_compat_meta_box' => false, 106 ] 21 107 ); 108 22 109 } 23 110 … … 32 119 break; 33 120 } 34 ?> 121 122 $title_value = get_post_meta( $post->ID, '_seo_meta_title', true ); 123 $title_value_depr = get_post_meta( $post->ID, 'seo_meta_title', true ); 124 $description_value = get_post_meta( $post->ID, '_seo_meta_description', true ); 125 $description_value_depr = get_post_meta( $post->ID, 'seo_meta_description', true ); 126 $og_image_value = get_post_meta( $post->ID, '_seo_meta_og_image', true ); 127 $og_image_value_depr = get_post_meta( $post->ID, 'seo_meta_og_image', true ); 128 129 $title_val = empty( $title_value_depr ) ? $title_value ?? '' : $title_value_depr; 130 $description_val = empty( $description_value_depr ) ? $description_value ?? '' : $description_value_depr; 131 $og_image_val = empty( $og_image_value_depr ) ? $og_image_value ?? '' : $og_image_value_depr; 132 133 ?> 35 134 <div class="seo-meta-box-container"> 36 135 <p><?php echo esc_html( $meta_title ); ?> (meta tag title): 37 <input type="text" name=" seo_meta_title" style="width:100%;" value="<?php echo esc_html( get_post_meta($post->ID, 'seo_meta_title', 1)); ?>" />136 <input type="text" name="_seo_meta_title" style="width:100%;" value="<?php echo esc_html( $title_val ); ?>" /> 38 137 </p> 39 138 <p><?php esc_html_e( "Article description", "altss" ); ?> (meta tag description): 40 <textarea name=" seo_meta_description" style="width:100%;height:100px;"><?php echo esc_textarea( get_post_meta($post->ID, 'seo_meta_description', 1)); ?></textarea>139 <textarea name="_seo_meta_description" style="width:100%;height:100px;"><?php echo esc_textarea( $description_val ); ?></textarea> 41 140 </p> 42 141 <p><?php esc_html_e( 'og:image', 'altss' ); ?><br /> … … 44 143 <?php 45 144 altss_include_uploadscript(); 46 altss_image_uploader_field( ' seo_meta_og_image', esc_url( get_post_meta($post->ID, 'seo_meta_og_image', 1)) );145 altss_image_uploader_field( '_seo_meta_og_image', esc_url( $og_image_val ) ); 47 146 ?> 48 147 </p> … … 63 162 return false; 64 163 65 $meta_title = sanitize_text_field( $_POST[' seo_meta_title'] );66 $meta_description = sanitize_textarea_field ( $_POST[' seo_meta_description'] );67 $meta_og_image = sanitize_url ( $_POST[' seo_meta_og_image'] );164 $meta_title = sanitize_text_field( $_POST['_seo_meta__title'] ); 165 $meta_description = sanitize_textarea_field ( $_POST['_seo_meta__description'] ); 166 $meta_og_image = sanitize_url ( $_POST['_seo_meta__og_image'] ); 68 167 69 168 if( empty( $meta_title ) ){ 70 delete_post_meta( $post_id, ' seo_meta_title' );169 delete_post_meta( $post_id, '_seo_meta__title' ); 71 170 } 72 171 else { 73 update_post_meta( $post_id, ' seo_meta_title', $meta_title );172 update_post_meta( $post_id, '_seo_meta__title', $meta_title ); 74 173 } 75 174 76 175 if( empty( $meta_description ) ){ 77 delete_post_meta( $post_id, ' seo_meta_description' );176 delete_post_meta( $post_id, '_seo_meta__description' ); 78 177 } 79 178 else { 80 update_post_meta( $post_id, ' seo_meta_description', $meta_description );179 update_post_meta( $post_id, '_seo_meta__description', $meta_description ); 81 180 } 82 181 83 182 if( empty( $meta_og_image ) ){ 84 delete_post_meta( $post_id, ' seo_meta_og_image' );183 delete_post_meta( $post_id, '_seo_meta__og_image' ); 85 184 } 86 185 else { 87 update_post_meta( $post_id, ' seo_meta_og_image', $meta_og_image );186 update_post_meta( $post_id, '_seo_meta__og_image', $meta_og_image ); 88 187 } 89 188 -
alternative-site-settings/trunk/languages/altss-ru_RU.po
r3397897 r3404041 155 155 msgstr "Краткое описание альбома" 156 156 157 msgid "All News Categories" 158 msgstr "Все категории новостей" 159 157 160 msgid "All News categories" 158 161 msgstr "Все категории новостей" … … 1004 1007 msgstr "Удаление плагина" 1005 1008 1009 msgid "Replace image" 1010 msgstr "Заменить изображение" 1011 1006 1012 msgid "Reply to review" 1007 1013 msgstr "Ответить на отзыв" … … 1052 1058 msgstr "Поиск видео категории" 1053 1059 1060 msgid "Select an image" 1061 msgstr "Выбрать изображение" 1062 1054 1063 msgid "Select form" 1055 1064 msgstr "Выберите форму" -
alternative-site-settings/trunk/readme.txt
r3397897 r3404041 3 3 Requires at least: 5.9 4 4 Tested up to: 6.8.3 5 Stable tag: 1.2. 15 Stable tag: 1.2.2 6 6 Requires PHP: 7.2 7 7 License: GPLv2 or later … … 34 34 == Changelog == 35 35 36 = 1.2.2 = 37 Fixed an issue with the display of the "Data for SEO promotion" metabox depending on the position of the "check the box to enable META & SEO functionality" checkbox. 38 The "Data for SEO promotion" meta box has been moved to the sidebar in the Gutenberg editor. This meta box remains unchanged in the Classic Editor. 39 36 40 = 1.2.1 = 37 41 Fixed a bug with an empty title meta tag. 38 The captions for the color fields in the cookie banner settings in the admin panel have been corrected.42 The captions for the button color fields in the cookie banner settings in the admin panel have been corrected. 39 43 Added missing Russian translation strings. 40 44 … … 77 81 = How contact forms are displayed in a theme? = 78 82 79 During plugin activation, the cf-style.css and cf-script.js files are copied to the “css” and “js” directories located in the “assets” directory of the active theme, respectively. The filesdo not80 overwrite existing file s- this is done so that you can set individual styles for forms, unique to each theme. When activating a new theme, the plugin will also have to be activated again.83 During plugin activation, the cf-style.css and cf-script.js files are copied to the “css” and “js” directories located in the “assets” directory of the active theme, respectively. The cf-style.css file do not 84 overwrite existing file - this is done so that you can set individual styles for forms, unique to each theme. When activating a new theme, the plugin will also have to be activated again. 81 85 The display of buttons and forms is carried out either using a shortcode, or by directly registering the buttons in the header file of the theme itself. 82 86
Note: See TracChangeset
for help on using the changeset viewer.