83% g-structured-data

Code Review | G Structured Data

WordPress plugin G Structured Data scored83%from 54 tests.

About plugin

  • Plugin page: g-structured-data
  • Plugin version: 1.1.6
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.2.1
  • WordPress version: 6.3.1
  • First release: Jun 18, 2019
  • Latest release: Jul 17, 2019
  • Number of updates: 17
  • Update frequency: every 1.8 days
  • Top authors: sinanyorulmaz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /656 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.44MB] [CPU: ▼19.37ms] Passed 4 tests

This is a short check of server-side resources used by G Structured Data
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.97 ▲0.2446.43 ▲1.23
Dashboard /wp-admin3.87 ▲0.2452.19 ▼13.06
Posts /wp-admin/edit.php3.92 ▲0.2449.62 ▼1.24
Add New Post /wp-admin/post-new.php3.66 ▼2.4940.90 ▼57.47
Media Library /wp-admin/upload.php3.73 ▲0.2439.54 ▼5.70

Server storage [IO: ▲0.13MB] [DB: ▲0.00MB] Passed 3 tests

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 11 new files
Database: no new tables, 28 new options
New WordPress options
gsd_hashtags_background_color
gsd_hashtags_hover_background_color
gsd_publisher_logo_url
gsd_publisher_name
gsd_contact_card_border_color
gsd_structured_data_active
gsd_contact_card_activation
gsd_updating_content_dates_gmt_diff
can_compress_scripts
theysaidso_admin_options
...

Browser metrics Passed 4 tests

G Structured Data: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲4714.30 ▼0.351.88 ▼0.0841.89 ▼0.62
Dashboard /wp-admin2,214 ▲345.64 ▼0.0484.59 ▼10.2138.46 ▼7.06
Posts /wp-admin/edit.php2,116 ▲161.97 ▼0.0637.96 ▲0.9335.18 ▼2.66
Add New Post /wp-admin/post-new.php6,602 ▲5,05726.18 ▲2.94889.67 ▲176.7368.27 ▲15.53
Media Library /wp-admin/upload.php1,419 ▲194.22 ▼0.03100.42 ▼12.7944.40 ▼0.80

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 28 options
    • gsd_updating_content_dates_gmt_diff
    • gsd_publisher_logo_url
    • gsd_hashtags_text_color
    • gsd_structured_data_active
    • gsd_background_color
    • gsd_post_types
    • gsd_site_tracking_codes_activation
    • gsd_contact_card_background_color
    • theysaidso_admin_options
    • gsd_hashtags_background_color
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/g-structured-data/gsd-admin.php:47
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/g-structured-data/gsd-category-functions.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/g-structured-data/includes/class/gsd_widget.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_errors() in wp-content/plugins/g-structured-data/includes/gsd-admin-template.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/g-structured-data/includes/class/gsd_widget.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/g-structured-data/includes/class/gsd_widget.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes: Please take inspiration from this readme.txt

g-structured-data/index.php 85% from 13 tests

Analyzing the main PHP file in "G Structured Data" version 1.1.6
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("g-structured-data.php" instead of "index.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 187 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin1,656 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP6176131,314
Sass1680341
CSS1011

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity8.00
▷ Minimum class complexity5.00
▷ Maximum class complexity11.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/hashtags.png30.36KB12.48KB▼ 58.90%