10% simple-json-ld-header-adder

Code Review | Simple JSON-LD Header Adder

WordPress plugin Simple JSON-LD Header Adder scored10%from 54 tests.

About plugin

  • Plugin page: simple-json-ld-he...
  • Plugin version: 20181006...
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Oct 7, 2018
  • Latest release: Oct 7, 2018
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: sw1344 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /604 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • The plugin did not install without errors
    • > User notice in wp-includes/functions.php+5905
    Function register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)

Server metrics [RAM: ▼1.93MB] [CPU: ▼49.20ms] Passed 4 tests

Server-side resources used by Simple JSON-LD Header Adder
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.395.40 ▼35.38
Dashboard /wp-admin2.09 ▼1.255.80 ▼51.18
Posts /wp-admin/edit.php2.09 ▼1.275.96 ▼36.72
Add New Post /wp-admin/post-new.php2.09 ▼3.805.85 ▼73.52
Media Library /wp-admin/upload.php2.09 ▼1.146.39 ▼26.68
Simple JSON-LD /wp-admin/options-general.php?page=index_admin2.095.56

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Simple JSON-LD Header Adder
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲8513.55 ▼0.824.47 ▲2.7244.46 ▲5.30
Dashboard /wp-admin2,212 ▲604.89 ▼0.75104.27 ▲2.8239.10 ▼7.84
Posts /wp-admin/edit.php2,095 ▲62.01 ▼0.0340.22 ▲4.5235.69 ▲4.21
Add New Post /wp-admin/post-new.php1,539 ▲2022.97 ▼0.44657.51 ▼50.2058.90 ▲2.27
Media Library /wp-admin/upload.php1,397 ▲94.19 ▼0.0398.01 ▼6.9342.48 ▼15.19
Simple JSON-LD /wp-admin/options-general.php?page=index_admin7692.0223.2927.46

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5905
    Function register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=index_admin
    • > User notice in wp-includes/functions.php+5905
    Function register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)
    • > GET request to /wp-admin/options-general.php?page=index_admin
    • > Notice in wp-content/plugins/simple-json-ld-header-adder/index.php+152
    Undefined property: bh_simplejsonld::$optionname

SRP 50% 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× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-json-ld-header-adder/index.php:34

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Contributors: Contributors not specified
The official readme.txt might help

simple-json-ld-header-adder/index.php 85% from 13 tests

The main file in "Simple JSON-LD Header Adder" v. 20181006... serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Version: The version number should only use digits and periods (ex. "1.0.3" instead of "20181006...")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("simple-json-ld-header-adder.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin105 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP12644105

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity18.00
▷ Minimum class complexity18.00
▷ Maximum class complexity18.00
Average method complexity3.12
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods112.50%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin