70% schema-and-structured-data-for-wp

Code Review | Schema & Structured Data for WP & AMP

WordPress plugin Schema & Structured Data for WP & AMP scored70%from 54 tests.

About plugin

  • Plugin page: schema-and-struct...
  • Plugin version: 1.24
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.4
  • WordPress version: 6.3.1
  • First release: Aug 6, 2018
  • Latest release: Nov 29, 2023
  • Number of updates: 421
  • Update frequency: every 4.6 days
  • Top authors: magazine3 (87.17%)ampforwp (8.79%)mohammed_kaludi (4.51%)

Code review

54 tests

User reviews

232 reviews

Install metrics

100,000+ active /4,708,695 total downloads

Benchmarks

Plugin footprint 81% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲8.87MB] [CPU: ▲56.07ms] 25% from 4 tests

An overview of server-side resources used by Schema & Structured Data for WP & AMP
It is recommended to improve the following
  • RAM: Total memory usage must be kept under 10MB (currently 12.06MB on /wp-admin/edit.php?post_type=saswp&page=structured_data_premium)
  • CPU: The total CPU usage must kept under 500.00ms (currently 980.67ms on /wp-admin/edit.php?post_type=saswp&page=structured_data_options)
  • Extra RAM: The extra memory usage should kept under 5MB (currently 8.87MB on /wp-admin/edit.php?post_type=saswp&page=structured_data_premium)
PageMemory (MB)CPU Time (ms)
Home /12.37 ▲8.9195.20 ▲56.34
Dashboard /wp-admin12.15 ▲8.81112.65 ▲49.82
Posts /wp-admin/edit.php12.27 ▲8.91124.24 ▲74.82
Add New Post /wp-admin/post-new.php14.84 ▲8.96154.94 ▲51.37
Media Library /wp-admin/upload.php12.08 ▲8.85100.92 ▲66.76
/wp-admin/edit.php?post_type=saswp&page=collection12.0697.08
Schema Types /wp-admin/edit.php?post_type=saswp12.16104.40
Reviews /wp-admin/edit.php?post_type=saswp_reviews12.45105.17
Settings /wp-admin/edit.php?post_type=saswp&page=structured_data_options12.71980.67
Upgrade To Premium /wp-admin/edit.php?post_type=saswp&page=structured_data_premium12.06105.60

Server storage [IO: ▲6.32MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 302 new files
Database: no new tables, 11 new options
New WordPress options
saswp_social_profile_upgrade
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
db_upgraded
sd_data
saswp_installation_date
widget_saswp_location_widget
...

Browser metrics Passed 4 tests

Schema & Structured Data for WP & AMP: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,839 ▲9214.25 ▲0.001.73 ▲0.0436.60 ▼7.07
Dashboard /wp-admin2,241 ▲645.63 ▼0.0494.82 ▼2.8342.04 ▼2.97
Posts /wp-admin/edit.php2,146 ▲431.99 ▲0.0539.78 ▲1.7734.61 ▲0.78
Add New Post /wp-admin/post-new.php1,683 ▲15721.10 ▼2.12718.53 ▲83.5245.86 ▼8.51
Media Library /wp-admin/upload.php1,446 ▲494.25 ▲0.0796.75 ▲0.5741.71 ▲0.23
/wp-admin/edit.php?post_type=saswp&page=collection1,1353.6866.8830.05
Schema Types /wp-admin/edit.php?post_type=saswp1,4503.9871.4938.33
Reviews /wp-admin/edit.php?post_type=saswp_reviews2,1014.0171.8043.35
Settings /wp-admin/edit.php?post_type=saswp&page=structured_data_options5,9434.89185.18135.12
Upgrade To Premium /wp-admin/edit.php?post_type=saswp&page=structured_data_premium7311.8514.0321.25

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 75% from 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 11 options in the database
    • widget_recent-comments
    • db_upgraded
    • saswp_social_profile_upgrade
    • sd_data
    • widget_recent-posts
    • theysaidso_admin_options
    • saswp_installation_date
    • widget_saswp_location_widget
    • widget_theysaidso_widget
    • can_compress_scripts
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/edit.php?post_type=saswp&page=collection
    • > Notice in wp-content/plugins/schema-and-structured-data-for-wp/modules/reviews/reviews_collection.php+671
    Undefined index: _wpnonce
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=saswp&page=structured_data_premium
    • > Warning in wp-includes/pluggable.php+1438
    Cannot modify header information - headers already sent by (output started at wp-includes/script-loader.php:2838)

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/schema-and-structured-data-for-wp/admin_section/images/spinner.php
  • 12× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/schema-and-structured-data-for-wp/modules/divi-builder/extension.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'ET_Builder_Module' not found in wp-content/plugins/schema-and-structured-data-for-wp/modules/divi-builder/includes/modules/FaqBlockChild/FaqBlockChild.php:3
    • > PHP Notice
      Undefined variable: amp_blacklist_sanitizer in wp-content/plugins/schema-and-structured-data-for-wp/core/3rd-party/class-amp-review-form-blacklist.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/schema-and-structured-data-for-wp/admin_section/add-schema/add_new.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/schema-and-structured-data-for-wp/admin_section/plugin-installer/install.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/schema-and-structured-data-for-wp/modules/tinymce/register-tinymce.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/schema-and-structured-data-for-wp/admin_section/tracking/deactivate-feedback.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'DiviExtension' not found in wp-content/plugins/schema-and-structured-data-for-wp/modules/divi-builder/includes/Extension.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'ET_Builder_Module' not found in wp-content/plugins/schema-and-structured-data-for-wp/modules/divi-builder/includes/modules/FaqBlock/FaqBlock.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/schema-and-structured-data-for-wp/output/location.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed: Please take inspiration from this readme.txt

schema-and-structured-data-for-wp/structured-data-for-wp.php 77% from 13 tests

"Schema & Structured Data for WP & AMP" version 1.24's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Domain Path: The domain path folder was not found ("/languages")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("schema-and-structured-data-for-wp.php" instead of "structured-data-for-wp.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 141 characters long)

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected78,808 lines of code in 155 files:
LanguageFilesBlank linesComment linesLines of code
PHP6812,6672,11453,973
CSS4286235112,531
JavaScript412,30428811,572
SVG3183689
JSX113243

PHP code 0% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 2,520)
  • Method cyclomatic complexity should be reduced to less than 100 (currently 1,960)
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity126.41
▷ Minimum class complexity1.00
▷ Maximum class complexity2,520.00
Average method complexity11.29
▷ Minimum method complexity1.00
▷ Maximum method complexity1,960.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes32
▷ Abstract classes00.00%
▷ Concrete classes32100.00%
▷ Final classes00.00%
Methods392
▷ Static methods92.30%
▷ Public methods36693.37%
▷ Protected methods92.30%
▷ Private methods174.34%
Functions455
▷ Named functions44898.46%
▷ Anonymous functions71.54%
Constants11
▷ Global constants1090.91%
▷ Class constants19.09%
▷ Public constants1100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
136 PNG files occupy 0.90MB with 0.16MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin_section/images/reviews_platform_icon/glassdoor-img.png1.61KB1.25KB▼ 22.48%
admin_section/images/reviews_platform_icon/clutch-com-img.png3.17KB3.18KB0.00%
admin_section/images/reviews_platform_icon/Best_Buy_logo.svg.png1.50KB1.27KB▼ 15.39%
admin_section/images/reviews_platform_icon/g2crowd-img.png1.61KB1.11KB▼ 31.27%
admin_section/images/check.png1.24KB0.98KB▼ 20.32%