84% ut-demo-importer

Code Review | Ultra Demo Importer

WordPress plugin Ultra Demo Importer scored84%from 54 tests.

About plugin

  • Plugin page: ut-demo-importer
  • Plugin version: 1.0.5
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-6.0.1
  • WordPress version: 6.3.1
  • First release: Apr 30, 2020
  • Latest release: Aug 4, 2022
  • Number of updates: 14
  • Update frequency: every 59.1 days
  • Top authors: uncodethemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /3,674 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.34MB] [CPU: ▼1.57ms] Passed 4 tests

A check of server-side resources used by Ultra Demo Importer
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.78 ▲0.3145.97 ▲2.99
Dashboard /wp-admin3.69 ▲0.3846.06 ▲1.25
Posts /wp-admin/edit.php3.74 ▲0.3850.67 ▲0.60
Add New Post /wp-admin/post-new.php6.22 ▲0.3481.53 ▼11.13
Media Library /wp-admin/upload.php3.55 ▲0.3235.98 ▲4.04

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Ultra Demo Importer
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲9513.41 ▼0.881.89 ▼0.1542.79 ▲0.70
Dashboard /wp-admin2,222 ▲345.94 ▲1.01109.89 ▼3.9738.84 ▼2.34
Posts /wp-admin/edit.php2,102 ▲162.31 ▲0.3039.12 ▲2.9731.88 ▼2.18
Add New Post /wp-admin/post-new.php1,530 ▼1223.76 ▲5.49678.75 ▲52.9337.64 ▼15.56
Media Library /wp-admin/upload.php1,404 ▲194.36 ▲0.1999.38 ▲3.0942.05 ▼0.88

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/ut-demo-importer/view/view-head.php:3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/ut-demo-importer/CustomizerOption.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/ut-demo-importer/ut-demo-importer.php:19
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/ut-demo-importer/view/view-body.php:4
    • > PHP Warning
      require_once(ABSPATHwp-includes/class-wp-customize-setting.php): failed to open stream: No such file or directory in wp-content/plugins/ut-demo-importer/CustomizerOption.php on line 11
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-includes/class-wp-customize-setting.php' (include_path='.:/usr/share/php') in wp-content/plugins/ut-demo-importer/CustomizerOption.php on line 11

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
3 plugin tags: elementor, demo, importer

ut-demo-importer/ut-demo-importer.php Passed 13 tests

Analyzing the main PHP file in "Ultra Demo Importer" version 1.0.5
114 characters long description:
Ultra Demo Importer is a plugin to import ready to use demo sites for different themes developed by Uncode themes.

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 plugin5,436 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP93876022,407
JavaScript55519142,378
CSS32520651

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity49.11
▷ Minimum class complexity1.00
▷ Maximum class complexity214.00
Average method complexity6.76
▷ Minimum method complexity1.00
▷ Maximum method complexity50.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes111.11%
▷ Concrete classes888.89%
▷ Final classes112.50%
Methods76
▷ Static methods79.21%
▷ Public methods7092.11%
▷ Protected methods33.95%
▷ Private methods33.95%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.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
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/screenshot.png1.24KB1.15KB▼ 7.57%
assets/img/done.png5.97KB2.82KB▼ 52.68%