78% wpt-demo-importer

Code Review | WPT Demo Importer

WordPress plugin WPT Demo Importer scored 78% from 54 tests.

About plugin

  • Plugin page: wpt-demo-importer
  • Plugin version: 1.0.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.5.1
  • WordPress version: 6.3.1
  • First release: Sep 10, 2019
  • Latest release: Sep 21, 2020
  • Number of updates: 16
  • Update frequency: every 23.6 days
  • Top authors: primatree (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 3,285 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.04MB] [CPU: ▼3.96ms] Passed 4 tests

Analyzing server-side resources used by WPT Demo Importer
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0537.94 ▼2.56
Dashboard /wp-admin3.35 ▲0.0442.96 ▲0.20
Posts /wp-admin/edit.php3.46 ▲0.1042.78 ▼6.29
Add New Post /wp-admin/post-new.php5.93 ▲0.0491.74 ▼7.20
Media Library /wp-admin/upload.php3.27 ▲0.0436.04 ▲4.45
Import Demo Data /wp-admin/themes.php?page=pt-one-click-demo-import3.3031.41

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 35 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for WPT Demo Importer
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲9413.18 ▼1.225.03 ▲3.3443.67 ▲2.11
Dashboard /wp-admin2,210 ▲194.85 ▼0.07104.06 ▲3.8039.87 ▼0.08
Posts /wp-admin/edit.php2,093 ▲41.99 ▼0.0234.33 ▼0.4735.84 ▲1.33
Add New Post /wp-admin/post-new.php1,536 ▲1623.75 ▲0.67651.27 ▼3.8452.42 ▼5.13
Media Library /wp-admin/upload.php1,392 ▲44.29 ▲0.1393.48 ▼12.7843.79 ▲1.00
Import Demo Data /wp-admin/themes.php?page=pt-one-click-demo-import7602.0136.7326.41

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% 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)
Good news, no errors were detected

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
Please fix the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wpt-demo-importer/WPT-Demo-Importer.php
  • 7× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'PrimaTree\\WPContentImporter2\\WPImporterLoggerCLI' not found in wp-content/plugins/wpt-demo-importer/inc/Logger.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI_Command' not found in wp-content/plugins/wpt-demo-importer/inc/WPCLICommands.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Setting' not found in wp-content/plugins/wpt-demo-importer/inc/CustomizerOption.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'PrimaTree\\WPContentImporter2\\WXRImporter' not found in wp-content/plugins/wpt-demo-importer/inc/WXRImporter.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'PrimaTree\\WPContentImporter2\\WPImporterLogger' not found in wp-content/plugins/wpt-demo-importer/vendor/primatree/wp-content-importer-v2/src/WPImporterLoggerCLI.php:4
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wpt-demo-importer/views/plugin-page.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Importer' not found in wp-content/plugins/wpt-demo-importer/vendor/primatree/wp-content-importer-v2/src/WXRImporter.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: primaapp, demo, import, wptrees

wpt-demo-importer/WPT-Demo-Importer.php 85% from 13 tests

"WPT Demo Importer" version 1.0.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wpt-demo-importer.php" instead of "WPT-Demo-Importer.php")
  • Text Domain: Please use dashes and lowercase characters for text domains

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected5,406 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP251,0151,8143,468
XML158741,380
CSS16912284
JavaScript15364210
JSON20064

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity28.20
▷ Minimum class complexity1.00
▷ Maximum class complexity290.00
Average method complexity4.15
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes20
▷ Abstract classes00.00%
▷ Concrete classes20100.00%
▷ Final classes15.00%
Methods173
▷ Static methods3520.23%
▷ Public methods11063.58%
▷ Protected methods3620.81%
▷ Private methods2715.61%
Functions6
▷ Named functions350.00%
▷ Anonymous functions350.00%
Constants5
▷ Global constants360.00%
▷ Class constants240.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 compressed PNG file occupies 0.17MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
settings/WPT-Demo-PrimaApp/ptdemom.png170.93KB162.67KB▼ 4.83%