72% schemaninja

Code Review | Schema Ninja

WordPress plugin Schema Ninja scored72%from 54 tests.

About plugin

  • Plugin page: schemaninja
  • Plugin version: 2.3.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.4.2
  • WordPress version: 6.3.1
  • First release: Sep 15, 2016
  • Latest release: Sep 15, 2020
  • Number of updates: 67
  • Update frequency: every 21.8 days
  • Top authors: jitendravaswani (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

10+ active /4,960 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.40MB] [CPU: ▼15.73ms] Passed 4 tests

A check of server-side resources used by Schema Ninja
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.2643.57 ▲4.16
Dashboard /wp-admin3.60 ▲0.3049.89 ▼3.35
Posts /wp-admin/edit.php3.70 ▲0.3448.45 ▼4.35
Add New Post /wp-admin/post-new.php3.40 ▼2.4940.60 ▼59.37
Media Library /wp-admin/upload.php3.56 ▲0.3335.68 ▲5.36
All Recommendations /wp-admin/edit.php?post_type=recommendations3.5437.82
Add New /wp-admin/post-new.php?post_type=recommendations3.4036.17

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 82 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Schema Ninja
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,969 ▲20813.43 ▼1.138.32 ▲6.7433.56 ▼9.68
Dashboard /wp-admin2,247 ▲705.80 ▲0.1885.69 ▼4.5085.79 ▲38.50
Posts /wp-admin/edit.php2,180 ▲802.03 ▲0.0239.06 ▼2.3739.46 ▲1.53
Add New Post /wp-admin/post-new.php1,592 ▲6618.32 ▼4.73765.91 ▲127.7854.45 ▲6.50
Media Library /wp-admin/upload.php1,464 ▲704.13 ▼0.06100.91 ▲1.7067.36 ▲22.39
All Recommendations /wp-admin/edit.php?post_type=recommendations1,1561.9838.2534.23
Add New /wp-admin/post-new.php?post_type=recommendations1,6723.4961.7069.09

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts

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
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/post-new.php?post_type=recommendations
    • > Notice in wp-content/plugins/schemaninja/admin/review_data.php+9
    Undefined index: review_title1
    • > GET request to /wp-admin/post-new.php?post_type=recommendations
    • > Notice in wp-content/plugins/schemaninja/admin/review_data.php+18
    Undefined index: review_name
    • > GET request to /wp-admin/post-new.php?post_type=recommendations
    • > Notice in wp-content/plugins/schemaninja/admin/review_data.php+28
    Undefined index: review_price
    • > GET request to /wp-admin/post-new.php?post_type=recommendations
    • > Notice in wp-content/plugins/schemaninja/admin/review_data.php+37
    Undefined index: review_title
    • > GET request to /wp-admin/post-new.php?post_type=recommendations
    • > Notice in wp-content/plugins/schemaninja/admin/review_data.php+46
    Undefined index: review_position
    • > GET request to /wp-admin/post-new.php?post_type=recommendations
    • > Notice in wp-content/plugins/schemaninja/admin/review_data.php+55
    Undefined index: review_currency
    • > GET request to /wp-admin/post-new.php?post_type=recommendations
    • > Notice in wp-content/plugins/schemaninja/admin/review_data.php+64
    Undefined index: review_show
    • > GET request to /wp-admin/post-new.php?post_type=recommendations
    • > Notice in wp-content/plugins/schemaninja/admin/review_data.php+73
    Undefined index: review_rating
    • > GET request to /wp-admin/post-new.php?post_type=recommendations
    • > Notice in wp-content/plugins/schemaninja/admin/review_data.php+82
    Undefined index: review_btn_text
    • > GET request to /wp-admin/post-new.php?post_type=recommendations
    • > Notice in wp-content/plugins/schemaninja/admin/review_data.php+91
    Undefined index: specs_btn_text
    • > GET request to /wp-admin/post-new.php?post_type=recommendations
    • > Notice in wp-content/plugins/schemaninja/admin/review_data.php+100
    Undefined index: summary_btn_text
    • > GET request to /wp-admin/post-new.php?post_type=recommendations
    • > Notice in wp-content/plugins/schemaninja/admin/review_data.php+109
    Undefined index: try_btn_text
    • > GET request to /wp-admin/post-new.php?post_type=recommendations
    • > Notice in wp-content/plugins/schemaninja/admin/review_data.php+118
    Undefined index: review_url
    • > GET request to /wp-admin/post-new.php?post_type=recommendations
    • > Notice in wp-content/plugins/schemaninja/admin/review_data.php+127
    Undefined index: review_summary
    • > GET request to /wp-admin/post-new.php?post_type=recommendations
    • > Notice in wp-content/plugins/schemaninja/admin/review_data.php+136
    Undefined index: review_numvotes
    • > GET request to /wp-admin/post-new.php?post_type=recommendations
    • > Notice in wp-content/plugins/schemaninja/admin/review_data.php+145
    Undefined index: review_pros
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=recommendations
    • > Warning in wp-content/plugins/schemaninja/admin/review_data.php+167
    count(): Parameter must be an array or an object that implements Countable
    • > GET request to /wp-admin/post-new.php?post_type=recommendations
    • > Notice in wp-content/plugins/schemaninja/admin/review_data.php+160
    Undefined index: review_cons
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=recommendations
    • > Notice in wp-content/plugins/schemaninja/admin/recommendation_data.php+108
    Undefined index: rating_count
    • > GET request to /wp-admin/post-new.php?post_type=recommendations
    • > Notice in wp-content/plugins/schemaninja/admin/review_data.php+180
    Undefined index: review_0_metric
    • > GET request to /wp-admin/post-new.php?post_type=recommendations
    • > Notice in wp-content/plugins/schemaninja/admin/review_data.php+198
    Undefined index: spec_count
    • > GET request to /wp-admin/post-new.php?post_type=recommendations
    • > Notice in wp-content/plugins/schemaninja/admin/review_data.php+203
    Undefined index: spec_0_metric
    • > GET request to /wp-admin/post-new.php?post_type=recommendations
    • > Notice in wp-content/plugins/schemaninja/admin/recommendation_data.php+5
    Undefined index: recommendation_price
    • > GET request to /wp-admin/post-new.php?post_type=recommendations
    • > Notice in wp-content/plugins/schemaninja/admin/recommendation_data.php+14
    Undefined index: recommendation_title1
    • > GET request to /wp-admin/post-new.php?post_type=recommendations
    • > Notice in wp-content/plugins/schemaninja/admin/recommendation_data.php+23
    Undefined index: recommendation_trybtn
    • > GET request to /wp-admin/post-new.php?post_type=recommendations
    • > Notice in wp-content/plugins/schemaninja/admin/recommendation_data.php+32
    Undefined index: recommendation_currency
    • > GET request to /wp-admin/post-new.php?post_type=recommendations
    • > Notice in wp-content/plugins/schemaninja/admin/recommendation_data.php+41
    Undefined index: recommendation_rating
    • > GET request to /wp-admin/post-new.php?post_type=recommendations
    • > Notice in wp-content/plugins/schemaninja/admin/recommendation_data.php+50
    Undefined index: recommendation_pros
    • > GET request to /wp-admin/post-new.php?post_type=recommendations
    • > Notice in wp-content/plugins/schemaninja/admin/recommendation_data.php+65
    Undefined index: recommendation_cons
    • > GET request to /wp-admin/post-new.php?post_type=recommendations
    • > Notice in wp-content/plugins/schemaninja/admin/recommendation_data.php+80
    Undefined index: recommendation_url
    • > GET request to /wp-admin/post-new.php?post_type=recommendations
    • > Notice in wp-content/plugins/schemaninja/admin/recommendation_data.php+89
    Undefined index: custom_url
    • > GET request to /wp-admin/post-new.php?post_type=recommendations
    • > Notice in wp-content/plugins/schemaninja/admin/recommendation_data.php+98
    Undefined index: rec_short_dec
    • > GET request to /wp-admin/post-new.php?post_type=recommendations
    • > Notice in wp-content/plugins/schemaninja/admin/recommendation_data.php+116
    Undefined variable: metrics
    • > GET request to /wp-admin/post-new.php?post_type=recommendations
    • > Notice in wp-content/plugins/schemaninja/admin/recommendation_data.php+117
    Undefined variable: values

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/schemaninja/templates/recommendation_admin_metabox.php
  • 52× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: rating in wp-content/plugins/schemaninja/templates/recommendation_admin_metabox.php on line 23
    • > PHP Notice
      Undefined variable: i in wp-content/plugins/schemaninja/templates/recommendation_admin_metabox.php on line 203
    • > PHP Notice
      Undefined variable: cons_count in wp-content/plugins/schemaninja/templates/recommendation_admin_metabox.php on line 102
    • > PHP Notice
      Undefined variable: pros_count in wp-content/plugins/schemaninja/templates/recommendation_admin_metabox.php on line 55
    • > PHP Notice
      Undefined variable: rating in wp-content/plugins/schemaninja/templates/recommendation_admin_metabox.php on line 18
    • > PHP Notice
      Undefined variable: ratings in wp-content/plugins/schemaninja/templates/recommendation_admin_metabox.php on line 161
    • > PHP Notice
      Undefined variable: pros_count in wp-content/plugins/schemaninja/templates/recommendation_admin_metabox.php on line 266
    • > PHP Notice
      Undefined variable: pros in wp-content/plugins/schemaninja/templates/recommendation_admin_metabox.php on line 58
    • > PHP Notice
      Undefined variable: cons_count in wp-content/plugins/schemaninja/templates/recommendation_admin_metabox.php on line 273
    • > PHP Notice
      Undefined variable: url in wp-content/plugins/schemaninja/templates/recommendation_admin_metabox.php on line 150

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tags: You are using too many tags: 23 tag instead of maximum 10
  • Screenshots: These screenshots do not have images: #1 (2.), #3 (4.), #5 ()
The official readme.txt is a good inspiration

schemaninja/schema-ninja.php 85% from 13 tests

The principal PHP file in "Schema Ninja" v. 2.3.5 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("schemaninja.php" instead of "schema-ninja.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 249 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin15,770 lines of code in 59 files:
LanguageFilesBlank linesComment linesLines of code
CSS677815,887
SVG3002,673
PHP141141482,059
Sass1537531,947
LESS1434441,758
JavaScript33681941,427
XML40019

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods375.00%
▷ Protected methods00.00%
▷ Private methods125.00%
Functions31
▷ Named functions31100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
11 PNG files occupy 0.21MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/minus-icon.png0.83KB0.54KB▼ 34.91%
assets/img/plus-icon.png0.93KB0.60KB▼ 35.88%
assets/img/menu-icon.png1.69KB1.14KB▼ 32.49%
screenshot-5.png35.00KB16.58KB▼ 52.64%
assets/img/menu-icon-2.png1.18KB0.77KB▼ 34.90%