84% mizan-demo-importer

Code Review | Mizan Demo Importer

WordPress plugin Mizan Demo Importer scored84%from 54 tests.

About plugin

  • Plugin page: mizan-demo-importer
  • Plugin version: 0.0.2
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.1.1
  • WordPress version: 6.3.1
  • First release: Feb 3, 2023
  • Latest release: Mar 25, 2023
  • Number of updates: 7
  • Update frequency: every 7.6 days
  • Top authors: mizanthemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /1,892 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
Install script ran successfully

Server metrics [RAM: ▲0.60MB] [CPU: ▼0.85ms] Passed 4 tests

This is a short check of server-side resources used by Mizan Demo Importer
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.10 ▲0.6443.63 ▲0.21
Dashboard /wp-admin3.94 ▲0.6352.05 ▲0.93
Posts /wp-admin/edit.php3.99 ▲0.6352.61 ▲3.26
Add New Post /wp-admin/post-new.php6.46 ▲0.5793.92 ▼7.82
Media Library /wp-admin/upload.php3.80 ▲0.5741.35 ▲4.61
Install Plugins /wp-admin/themes.php?page=mizan-importer-tgmpa-install-plugins4.0135.78

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Mizan Demo Importer
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,837 ▲7614.35 ▲0.001.84 ▲0.2741.38 ▼6.54
Dashboard /wp-admin2,240 ▲665.55 ▼0.1087.54 ▼9.5256.39 ▲10.16
Posts /wp-admin/edit.php2,160 ▲572.17 ▲0.2336.83 ▼5.7048.42 ▲14.43
Add New Post /wp-admin/post-new.php1,568 ▲4223.16 ▼0.48619.80 ▼104.5065.49 ▲7.86
Media Library /wp-admin/upload.php1,453 ▲534.18 ▼0.0898.40 ▼14.5262.09 ▲13.98
Install Plugins /wp-admin/themes.php?page=mizan-importer-tgmpa-install-plugins9922.0627.6141.16

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

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
Good news, no errors were detected

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
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      Use of undefined constant MDI_DIR - assumed 'MDI_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/mizan-demo-importer/theme-wizard/tgm/tgm.php on line 2
    • > PHP Warning
      require(MDI_DIRtheme-wizard/tgm/class-tgm-plugin-activation.php): failed to open stream: No such file or directory in wp-content/plugins/mizan-demo-importer/theme-wizard/tgm/tgm.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/mizan-demo-importer/theme-wizard/config.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/mizan-demo-importer/plugin.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/mizan-demo-importer/theme-wizard/tgm/class-tgm-plugin-activation.php:2012
    • > PHP Fatal error
      require(): Failed opening required 'MDI_DIRtheme-wizard/tgm/class-tgm-plugin-activation.php' (include_path='.:/usr/share/php') in wp-content/plugins/mizan-demo-importer/theme-wizard/tgm/tgm.php on line 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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
3 plugin tags: templates, one click demo import, website builder

mizan-demo-importer/plugin.php 92% from 13 tests

The main file in "Mizan Demo Importer" v. 0.0.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("mizan-demo-importer.php" instead of "plugin.php")

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 plugin4,415 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP55241,7102,714
CSS238191,070
JavaScript39641631

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity58.38
▷ Minimum class complexity1.00
▷ Maximum class complexity195.00
Average method complexity4.28
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods140
▷ Static methods139.29%
▷ Public methods11783.57%
▷ Protected methods2316.43%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants872.73%
▷ Class constants327.27%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 compressed PNG files occupy 0.03MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
theme-wizard/assets/images/battery.png9.22KB8.25KB▼ 10.49%
theme-wizard/assets/images/plugin.png6.19KB5.24KB▼ 15.26%
theme-wizard/assets/images/check-mark.png10.44KB9.66KB▼ 7.47%