Skip to content

Commit 2cfbfcf

Browse files
Akshay UrankarAkshay Urankar
authored andcommitted
- Improvement: Updated plugin metadata tags to improve search optimization
2 parents 9efcce3 + 8d6622d commit 2cfbfcf

22 files changed

+74664
-744
lines changed

.distignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ package.json
1717
package-lock.json
1818
phpunit.xml
1919
phpunit.xml.dist
20+
phpstan-baseline.neon
21+
phpstan.neon
22+
stubs-generator.php
2023
multisite.xml
2124
multisite.xml.dist
2225
phpcs.xml

.github/workflows/phpcs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Setup PHP
2222
uses: shivammathur/setup-php@v2
2323
with:
24-
php-version: 7.4
24+
php-version: 8.3
2525
coverage: none
2626
tools: composer, cs2pr
2727

Gruntfile.js

Lines changed: 76 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,85 @@
1-
module.exports = function(grunt) {
1+
module.exports = function (grunt) {
2+
"use strict";
23

3-
'use strict';
4+
// Project configuration
5+
grunt.initConfig({
6+
pkg: grunt.file.readJSON("package.json"),
47

5-
// Project configuration
6-
grunt.initConfig({
8+
addtextdomain: {
9+
options: {
10+
textdomain: "all-in-one-schemaorg-rich-snippets",
11+
},
12+
update_all_domains: {
13+
options: {
14+
updateDomains: true,
15+
},
16+
src: [
17+
"*.php",
18+
"**/*.php",
19+
"!.git/**/*",
20+
"!bin/**/*",
21+
"!node_modules/**/*",
22+
"!tests/**/*",
23+
],
24+
},
25+
},
726

8-
pkg: grunt.file.readJSON('package.json'),
27+
wp_readme_to_markdown: {
28+
your_target: {
29+
files: {
30+
"README.md": "readme.txt",
31+
},
32+
},
33+
},
934

10-
addtextdomain: {
11-
options: {
12-
textdomain: 'all-in-one-schemaorg-rich-snippets',
13-
},
14-
update_all_domains: {
15-
options: {
16-
updateDomains: true
17-
},
18-
src: ['*.php', '**/*.php', '!\.git/**/*', '!bin/**/*', '!node_modules/**/*', '!tests/**/*']
19-
}
20-
},
35+
makepot: {
36+
target: {
37+
options: {
38+
domainPath: "/languages",
39+
exclude: [".git/*", "bin/*", "node_modules/*", "tests/*"],
40+
mainFile: "index.php",
41+
potFilename: "all-in-one-schemaorg-rich-snippets.pot",
42+
potHeaders: {
43+
poedit: true,
44+
"x-poedit-keywordslist": true,
45+
},
46+
type: "wp-plugin",
47+
updateTimestamp: true,
48+
},
49+
},
50+
},
2151

22-
wp_readme_to_markdown: {
23-
your_target: {
24-
files: {
25-
'README.md': 'readme.txt'
26-
}
27-
},
28-
},
52+
compress: {
53+
main: {
54+
options: {
55+
archive: "all-in-one-schemaorg-rich-snippets.zip",
56+
},
57+
files: [
58+
{
59+
src: [
60+
"**/*",
61+
"!node_modules/**",
62+
"!tests/**",
63+
"!.git/**",
64+
"!bin/**",
65+
'!phpstan-baseline.neon',
66+
'!phpstan.neon',
67+
'!stubs-generator.php',
68+
],
69+
dest: "/",
70+
},
71+
],
72+
},
73+
},
74+
});
2975

30-
makepot: {
31-
target: {
32-
options: {
33-
domainPath: '/languages',
34-
exclude: ['\.git/*', 'bin/*', 'node_modules/*', 'tests/*'],
35-
mainFile: 'index.php',
36-
potFilename: 'all-in-one-schemaorg-rich-snippets.pot',
37-
potHeaders: {
38-
poedit: true,
39-
'x-poedit-keywordslist': true
40-
},
41-
type: 'wp-plugin',
42-
updateTimestamp: true
43-
}
44-
}
45-
},
76+
grunt.loadNpmTasks("grunt-wp-i18n");
77+
grunt.loadNpmTasks("grunt-wp-readme-to-markdown");
78+
grunt.loadNpmTasks("grunt-contrib-compress");
4679

47-
zip: {
48-
'release': {
49-
src: ['**/*', '!node_modules/**', '!tests/**', '!bin/**', '!**/*.zip'], // Exclude certain folders and existing zip files
50-
dest: 'all-in-one-schemaorg-rich-snippets.zip'
51-
}
52-
},
53-
});
80+
grunt.registerTask("i18n", ["addtextdomain", "makepot"]);
81+
grunt.registerTask("readme", ["wp_readme_to_markdown"]);
82+
grunt.registerTask("zip", ["compress"]); // Add this line to register the zip task
5483

55-
grunt.loadNpmTasks('grunt-wp-i18n');
56-
grunt.loadNpmTasks('grunt-wp-readme-to-markdown');
57-
grunt.loadNpmTasks('grunt-zip'); // Use grunt-zip instead
58-
59-
grunt.registerTask('i18n', ['addtextdomain', 'makepot']);
60-
grunt.registerTask('readme', ['wp_readme_to_markdown']);
61-
grunt.registerTask('release', ['zip:release']); // Add release command
62-
63-
grunt.util.linefeed = '\n';
84+
grunt.util.linefeed = "\n";
6485
};

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
**Tags:** schema markup, structured data, rich snippets, schema.org, schema
55
**Requires at least:** 3.7
66
**Tested up to:** 6.6
7-
**Stable tag:** 1.6.10
7+
**Stable tag:** 1.6.11
88
**License:** GPLv2 or later
99
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html
1010
Boost CTR. Improve SEO & Rankings. Supports most of the content type. Works perfectly with Google, Bing, Yahoo & Facebook.
@@ -80,8 +80,10 @@ Review, Event, People, Product, Recipe, Software Application, Video, Articles et
8080

8181
## Changelog ##
8282

83-
### 1.6.10.1 ###
84-
- Improvement: Updated plugin metadata tags to improve search optimization
83+
### 1.6.11 ###
84+
- Fixed: Improved code quality syntax and security checks for better coding standards and practices.
85+
- Fixed: Recipe - Author type fix.
86+
- Fixed: Video Upload Date issue.
8587

8688
### 1.6.10 ###
8789
- Fixed: Corrected the uploadDate format as per ISO 8601 standards with timezone.

admin/bsf-analytics/class-bsf-analytics-stats.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ private function get_default_stats() {
105105
/**
106106
* Get installed PHP version.
107107
*
108-
* @return float PHP version.
108+
* @return string PHP version.
109109
* @since 1.0.0
110110
*/
111111
private function get_php_version() {
@@ -232,7 +232,7 @@ private function is_content_writable() {
232232
/**
233233
* Get timezone string.
234234
*
235-
* @return string timezone string.
235+
* @return mixed timezone string.
236236
* @since 1.0.0
237237
*/
238238
function wp_timezone_string() {

admin/bsf-analytics/class-bsf-analytics.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ public function enqueue_assets() {
115115
$file_rtl = ( is_rtl() ) ? '-rtl' : '';
116116
$css_ext = ( SCRIPT_DEBUG ) ? '.css' : '.min.css';
117117

118-
$css_uri = BSF_ANALYTICS_URI . '/assets/css/' . $dir_name . '/style' . $file_rtl . $css_ext;
118+
$css_uri = ( defined( 'BSF_ANALYTICS_URI' ) ? BSF_ANALYTICS_URI : '' ) . '/assets/css/' . $dir_name . '/style' . $file_rtl . $css_ext;
119119

120-
wp_enqueue_style( 'bsf-analytics-admin-style', $css_uri, false, BSF_ANALYTICS_VERSION, 'all' );
120+
wp_enqueue_style( 'bsf-analytics-admin-style', $css_uri, false, ( defined( 'BSF_ANALYTICS_VERSION' ) ? BSF_ANALYTICS_VERSION : '' ), 'all' );
121121
}
122122

123123
/**
@@ -418,7 +418,7 @@ public function render_settings_field_html( $args ) {
418418
* Set analytics installed time in option.
419419
*
420420
* @param string $source source of analytics.
421-
* @return string $time analytics installed time.
421+
* @return string|mixed $time analytics installed time.
422422
* @since 1.0.0
423423
*/
424424
private function get_analytics_install_time( $source ) {

admin/index.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ function rich_snippet_dashboard() {
871871
</table>
872872
</form>
873873
</div>
874-
</div>' . get_support( 1 ) //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
874+
</div>' . get_support() //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
875875
. '
876876
</div>';
877877
echo '
@@ -923,6 +923,7 @@ function rich_snippet_dashboard() {
923923
print 'Sorry, your nonce did not verify.';
924924
exit;
925925
} else {
926+
$args = array(); // Defining the $args variable.
926927
foreach ( array( 'review_title', 'item_reviewer', 'review_date', 'item_name', 'item_rating' ) as $option ) {
927928
if ( isset( $_POST[ $option ] ) ) {
928929
$args[ $option ] = sanitize_text_field( $_POST[ $option ] );
@@ -938,6 +939,7 @@ function rich_snippet_dashboard() {
938939
print 'Sorry, your nonce did not verify.';
939940
exit;
940941
} else {
942+
$args = array(); // Defining the $args variable.
941943
foreach ( array( 'snippet_title', 'event_title', 'event_location', 'event_performer', 'start_time', 'end_time', 'event_desc', 'events_price' ) as $option ) {
942944
if ( isset( $_POST[ $option ] ) ) {
943945
$args[ $option ] = sanitize_text_field( $_POST[ $option ] );
@@ -953,6 +955,7 @@ function rich_snippet_dashboard() {
953955
print 'Sorry, your nonce did not verify.';
954956
exit;
955957
} else {
958+
$args = array(); // Defining the $args variable.
956959
foreach ( array( 'snippet_title', 'person_name', 'person_nickname', 'person_job_title', 'person_website', 'person_company', 'person_address' ) as $option ) {
957960
if ( isset( $_POST[ $option ] ) ) {
958961
$args[ $option ] = sanitize_text_field( $_POST[ $option ] );
@@ -968,6 +971,7 @@ function rich_snippet_dashboard() {
968971
print 'Sorry, your nonce did not verify.';
969972
exit;
970973
} else {
974+
$args = array(); // Defining the $args variable.
971975
foreach ( array( 'snippet_title', 'product_rating', 'product_brand', 'product_name', 'product_agr', 'product_price', 'product_avail' ) as $option ) {
972976
if ( isset( $_POST[ $option ] ) ) {
973977
$args[ $option ] = sanitize_text_field( $_POST[ $option ] );
@@ -983,6 +987,7 @@ function rich_snippet_dashboard() {
983987
print 'Sorry, your nonce did not verify.';
984988
exit;
985989
} else {
990+
$args = array(); // Defining the $args variable.
986991
foreach ( array( 'snippet_title', 'recipe_name', 'author_name', 'recipe_pub', 'recipe_prep', 'recipe_cook', 'recipe_time', 'recipe_desc', 'recipe_rating' ) as $option ) {
987992
if ( isset( $_POST[ $option ] ) ) {
988993
$args[ $option ] = sanitize_text_field( $_POST[ $option ] );
@@ -998,6 +1003,7 @@ function rich_snippet_dashboard() {
9981003
print 'Sorry, your nonce did not verify.';
9991004
exit;
10001005
} else {
1006+
$args = array(); // Defining the $args variable.
10011007
foreach ( array( 'snippet_title', 'software_rating', 'software_agr', 'software_price', 'software_name', 'software_os', 'software_website' ) as $option ) {
10021008
if ( isset( $_POST[ $option ] ) ) {
10031009
$args[ $option ] = sanitize_text_field( $_POST[ $option ] );
@@ -1013,6 +1019,7 @@ function rich_snippet_dashboard() {
10131019
print 'Sorry, your nonce did not verify.';
10141020
exit;
10151021
} else {
1022+
$args = array(); // Defining the $args variable.
10161023
foreach ( array( 'snippet_title', 'video_title', 'video_desc', 'video_time', 'video_date' ) as $option ) {
10171024
if ( isset( $_POST[ $option ] ) ) {
10181025
$args[ $option ] = sanitize_text_field( $_POST[ $option ] );
@@ -1028,6 +1035,7 @@ function rich_snippet_dashboard() {
10281035
print 'Sorry, your nonce did not verify.';
10291036
exit;
10301037
} else {
1038+
$args = array(); // Defining the $args variable.
10311039
foreach ( array( 'snippet_title', 'article_name', 'article_author', 'article_desc', 'article_image', 'article_publisher', 'article_publisher_logo' ) as $option ) {
10321040
if ( isset( $_POST[ $option ] ) ) {
10331041
$args[ $option ] = sanitize_text_field( $_POST[ $option ] );
@@ -1043,6 +1051,7 @@ function rich_snippet_dashboard() {
10431051
print 'Sorry, your nonce did not verify.';
10441052
exit;
10451053
} else {
1054+
$args = array(); // Defining the $args variable.
10461055
foreach ( array( 'snippet_title', 'service_type', 'service_area', 'service_desc', 'service_provider_name', 'provider_location', 'service_rating', 'service_channel', 'service_url_link' ) as $option ) {
10471056
if ( isset( $_POST[ $option ] ) ) {
10481057
$args[ $option ] = sanitize_text_field( $_POST[ $option ] );
@@ -1110,6 +1119,9 @@ function display_status( $status ) {
11101119
* @param string $option_to_reset .
11111120
*/
11121121
function bsf_reset_options( $option_to_reset ) {
1122+
if ( ! defined( 'AIOSRS_PRO_DIR' ) ) {
1123+
define( 'AIOSRS_PRO_DIR', '' );
1124+
}
11131125
require_once AIOSRS_PRO_DIR . '/settings.php';
11141126
if ( 'review' == $option_to_reset ) {
11151127
add_review_option();
@@ -1175,6 +1187,7 @@ function (response) {
11751187
});
11761188
</script>
11771189
<?php }
1190+
11781191
/**
11791192
* Get support.
11801193
*/

composer.json

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
{
22
"name": "brainstormforce/all-in-one-schemaorg-rich-snippets",
33
"description": "Get eye catching results in search engines with the most popular schema markup plugin.",
4-
"require": {},
54
"require-dev": {
65
"brainmaestro/composer-git-hooks": "^2.6",
76
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
87
"phpcompatibility/php-compatibility": "^9.3",
9-
"wp-coding-standards/wpcs": "^2.2"
8+
"wp-coding-standards/wpcs": "^2.2",
9+
"php-stubs/wordpress-stubs": "^6.6",
10+
"szepeviktor/phpstan-wordpress": "^1.3",
11+
"phpstan/phpstan": "^1.12",
12+
"php-stubs/generator": "^0.8.4",
13+
"phpunit/phpunit": "^10.5",
14+
"wp-cli/wp-cli": "^2.11",
15+
"squizlabs/php_codesniffer": "^3.10"
1016
},
1117
"extra": {
1218
"hooks": {
@@ -20,11 +26,21 @@
2026
"post-install-cmd": "vendor/bin/cghooks add --ignore-lock",
2127
"post-update-cmd": "vendor/bin/cghooks update",
2228
"format": "phpcbf --standard=phpcs.xml.dist",
23-
"lint": "phpcs --standard=phpcs.xml.dist"
29+
"lint": "phpcs --standard=phpcs.xml.dist",
30+
"gen-stubs": "php -d memory_limit=-1 vendor/bin/generate-stubs artifact/phpstan/all-in-one-schemaorg-rich-snippets/ --out=tests/php/stubs/aiosrs-stubs.php && rm -rf artifact/phpstan",
31+
"phpstan": "vendor/bin/phpstan --memory-limit=2048M analyse"
2432
},
2533
"config": {
2634
"allow-plugins": {
2735
"dealerdirect/phpcodesniffer-composer-installer": true
2836
}
37+
},
38+
"require": {
39+
"php": "^8.3",
40+
"composer/composer": "^2.7",
41+
"symfony/translation": "^6.4",
42+
"symfony/dependency-injection": "^6.4",
43+
"symfony/event-dispatcher-contracts": "^3.5",
44+
"symfony/event-dispatcher": "^6.4"
2945
}
3046
}

0 commit comments

Comments
 (0)