83% magic-schema

Code Review | Magic schema

WordPress plugin Magic schema scored83%from 54 tests.

About plugin

  • Plugin page: magic-schema
  • Plugin version: 1...
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8
  • WordPress version: 6.3.1
  • First release: May 19, 2020
  • Latest release: Sep 13, 2021
  • Number of updates: 11
  • Update frequency: every 43.9 days
  • Top authors: koroshabbasy (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /543 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼4.95ms] Passed 4 tests

Analyzing server-side resources used by Magic schema
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /13.85 ▲10.351,996,469.25 ▲1,996,418.33
Dashboard /wp-admin3.39 ▲0.0453.45 ▲0.79
Posts /wp-admin/edit.php3.50 ▲0.1049.38 ▼3.77
Add New Post /wp-admin/post-new.php5.99 ▲0.0687.70 ▼20.68
Media Library /wp-admin/upload.php3.31 ▲0.0442.19 ▲3.86

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 20 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Magic schema
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,799 ▲1314.68 ▲0.072.08 ▲0.1245.83 ▲3.56
Dashboard /wp-admin2,204 ▲275.52 ▼0.1391.38 ▼4.7645.30 ▼0.15
Posts /wp-admin/edit.php2,106 ▲61.99 ▼0.0236.47 ▼1.9535.53 ▲0.91
Add New Post /wp-admin/post-new.php6,247 ▲4,72125.96 ▲2.86911.35 ▲202.2957.64 ▲1.30
Media Library /wp-admin/upload.php1,409 ▲124.21 ▼0.02112.24 ▲6.2949.41 ▲3.48

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/magic-schema/inc/admin/add-metaboxes.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/magic-schema/inc/defined.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/magic-schema/inc/defined.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/magic-schema/inc/defined.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/magic-schema/inc/functions.php:101
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/magic-schema/inc/admin/create-MagicSchema.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (Metabox that can be seen after installation screenshot-1.png), #2 (Display on page screenshot-2.png), #3 (Show answers on the page screenshot-3.png), #4 (rich test google screenshot-4.png)
You can look at the official readme.txt

magic-schema/MagicSchema.php 85% from 13 tests

This is the main PHP file of "Magic schema" version 1..., providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("magic-schema.php" instead of "MagicSchema.php")
  • Version: Use only periods and digits for the version number (ex. "1.0.3" instead of "1...")

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 plugin427 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP75133235
CSS120112
JavaScript2221280

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.31
Average class complexity5.67
▷ Minimum class complexity1.00
▷ Maximum class complexity12.00
Average method complexity2.40
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods10
▷ Static methods220.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
7 PNG files occupy 0.13MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png37.40KB15.27KB▼ 59.17%
screenshot-1.png25.51KB10.02KB▼ 60.70%
assets/img/deleted.png4.46KB2.92KB▼ 34.67%
assets/img/bin.png2.03KB1.92KB▼ 5.06%
screenshot-4.png39.52KB16.57KB▼ 58.09%