83% demo-importer-plus

Code Review | Demo Importer Plus

WordPress plugin Demo Importer Plus scored 83% from 54 tests.

About plugin

  • Plugin page: demo-importer-plus
  • Plugin version: 1.1.8
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-6.2
  • WordPress version: 6.3.1
  • First release: Jun 12, 2021
  • Latest release: May 17, 2023
  • Number of updates: 23
  • Update frequency: every 30.7 days
  • Top authors: kraftplugins (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10,000+ active / 114,673 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.19MB] [CPU: ▼5.34ms] 75% from 4 tests

This is a short check of server-side resources used by Demo Importer Plus
The following require your attention
  • CPU: Try to keep total CPU usage under 500.00ms (currently 1,279.10ms on /wp-admin/themes.php?page=demo-importer-plus)
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1936.80 ▼2.38
Dashboard /wp-admin3.50 ▲0.1947.47 ▼3.49
Posts /wp-admin/edit.php3.61 ▲0.2548.65 ▼0.65
Add New Post /wp-admin/post-new.php6.08 ▲0.1985.05 ▼14.83
Media Library /wp-admin/upload.php3.42 ▲0.1934.46 ▲0.04
Demo Importer Plus /wp-admin/themes.php?page=demo-importer-plus3.701,279.10

Server storage [IO: ▲0.88MB] [DB: ▲0.03MB] Passed 3 tests

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

Browser metrics Passed 4 tests

A check of browser resources used by Demo Importer Plus
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.27 ▼1.311.74 ▲0.0639.90 ▲0.57
Dashboard /wp-admin2,213 ▲255.85 ▲0.9897.93 ▼2.7737.09 ▼8.03
Posts /wp-admin/edit.php2,096 ▲102.14 ▲0.1239.87 ▲4.9238.14 ▲1.90
Add New Post /wp-admin/post-new.php1,540 ▲2623.22 ▲5.74663.00 ▼11.9155.32 ▲0.16
Media Library /wp-admin/upload.php1,395 ▲44.15 ▼0.0394.73 ▼6.3240.93 ▼6.23
Demo Importer Plus /wp-admin/themes.php?page=demo-importer-plus1,8802.4731.4849.03

Uninstaller [IO: ▲0.00MB] [DB: ▲0.03MB] 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 7 options in the database
    • demo_importer_plus_recent_import_log_file
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 14× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/demo-importer-plus/inc/constants.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/demo-importer-plus/admin/partials/getting-started.php:6
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/image.php' (include_path='.:/usr/share/php') in wp-content/plugins/demo-importer-plus/inc/importers/batch-processing/class-demo-importer-plus-batch-processing.php on line 79
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/file.php): failed to open stream: No such file or directory in wp-content/plugins/demo-importer-plus/inc/importers/batch-processing/helpers/class-demo-importer-plus-image-importer.php on line 60
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/demo-importer-plus/inc/classes/class-demo-importer-plus-ajax.php:21
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/demo-importer-plus/inc/importers/batch-processing/class-demo-importer-plus-batch-processing.php on line 79
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/file.php' (include_path='.:/usr/share/php') in wp-content/plugins/demo-importer-plus/inc/importers/batch-processing/helpers/class-demo-importer-plus-image-importer.php on line 60
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/demo-importer-plus/inc/importers/class-demo-importer-plus-sites-helper.php:40
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/demo-importer-plus/inc/importers/batch-processing/helpers/class-demo-importer-plus-image-importer.php on line 60
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/demo-importer-plus/demo-importer-plus.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention: The official readme.txt is a good inspiration

demo-importer-plus/demo-importer-plus.php 92% from 13 tests

The primary PHP file in "Demo Importer Plus" version 1.1.8 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 145 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin13,755 lines of code in 44 files:
LanguageFilesBlank linesComment linesLines of code
PHP311,6652,5786,176
JavaScript64955355,001
Sass3105191,374
CSS2130171,113
SVG20191

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity36.62
▷ Minimum class complexity1.00
▷ Maximum class complexity276.00
Average method complexity4.27
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes26
▷ Abstract classes27.69%
▷ Concrete classes2492.31%
▷ Final classes00.00%
Methods274
▷ Static methods4817.52%
▷ Public methods20474.45%
▷ Protected methods5921.53%
▷ Private methods114.01%
Functions12
▷ Named functions325.00%
▷ Anonymous functions975.00%
Constants10
▷ Global constants880.00%
▷ Class constants220.00%
▷ Public constants2100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.15MB with 0.11MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/admin/sass/images/placeholder.png50.74KB25.55KB▼ 49.64%
(invalid) assets/images/placeholder.png105.54KB0.00KB▼ 100.00%