73% one-click-demo-import

Code Review | One Click Demo Import

WordPress plugin One Click Demo Import scored73%from 54 tests.

About plugin

  • Plugin page: one-click-demo-im...
  • Plugin version: 3.2.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.4
  • WordPress version: 6.3.1
  • First release: Mar 25, 2016
  • Latest release: Nov 23, 2023
  • Number of updates: 48
  • Update frequency: every 58.3 days
  • Top authors: capuderg (89.58%)proteusthemes (10.42%)donmhico (4.17%)

Code review

54 tests

User reviews

72 reviews

Install metrics

1,000,000+ active /14,124,435 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.05MB] [CPU: ▼4.39ms] Passed 4 tests

A check of server-side resources used by One Click Demo Import
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0337.69 ▼2.51
Dashboard /wp-admin3.38 ▲0.0347.14 ▼15.68
Posts /wp-admin/edit.php3.49 ▲0.1350.62 ▲3.67
Add New Post /wp-admin/post-new.php5.96 ▲0.0782.34 ▼3.04
Media Library /wp-admin/upload.php3.30 ▲0.0738.07 ▲4.10
Import Demo Data /wp-admin/admin.php?page=pt-one-click-demo-import3.1829.10
Import Demo Data /wp-admin/themes.php?page=one-click-demo-import3.4434.52

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 72 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for One Click Demo Import
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲7214.07 ▼0.321.91 ▲0.2240.98 ▼2.89
Dashboard /wp-admin2,202 ▲245.59 ▼0.1390.54 ▼15.7240.15 ▼3.99
Posts /wp-admin/edit.php2,104 ▲42.03 ▲0.0039.47 ▲3.8636.55 ▲5.11
Add New Post /wp-admin/post-new.php1,534 ▲823.13 ▼0.06570.61 ▼47.5969.76 ▲16.66
Media Library /wp-admin/upload.php1,401 ▼24.32 ▲0.15100.55 ▲4.3844.00 ▲0.14
Import Demo Data /wp-admin/admin.php?page=pt-one-click-demo-import280.410.073.59
Import Demo Data /wp-admin/themes.php?page=one-click-demo-import1,1771.6826.6256.36

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/one-click-demo-import/one-click-demo-import.php
  • 17× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'OCDI\\PluginInstaller' not found in wp-content/plugins/one-click-demo-import/views/install-plugins.php:10
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-upgrader.php): failed to open stream: No such file or directory in wp-content/plugins/one-click-demo-import/inc/PluginInstallerSkinSilent.php on line 11
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/one-click-demo-import/inc/PluginInstallerSkinSilent.php on line 11
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Importer' not found in wp-content/plugins/one-click-demo-import/vendor/awesomemotive/wp-content-importer-v2/src/WXRImporter.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'OCDI\\CreateDemoContent\\DemoContentCreator' not found in wp-content/plugins/one-click-demo-import/views/create-content.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'AwesomeMotive\\WPContentImporter2\\WPImporterLoggerCLI' not found in wp-content/plugins/one-click-demo-import/inc/Logger.php:10
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-upgrader.php' (include_path='.:/usr/share/php') in wp-content/plugins/one-click-demo-import/inc/PluginInstallerSkin.php on line 11
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-upgrader.php): failed to open stream: No such file or directory in wp-content/plugins/one-click-demo-import/inc/PluginInstallerSkin.php on line 11
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/one-click-demo-import/inc/PluginInstallerSkin.php on line 11
    • > PHP Fatal error
      Uncaught Error: Class 'OCDI\\PluginInstaller' not found in wp-content/plugins/one-click-demo-import/views/import.php:10

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=pt-one-click-demo-import
    • > Network (severe)
    wp-admin/admin.php?page=pt-one-click-demo-import - Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
8 plugin tags: widgets, theme options, demo, import, settings...

one-click-demo-import/one-click-demo-import.php Passed 13 tests

Analyzing the main PHP file in "One Click Demo Import" version 3.2.0
130 characters long description:
Import your content, widgets and theme settings with one click. Theme authors! Enable simple demo import for your theme demo data.

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 plugin9,741 lines of code in 69 files:
LanguageFilesBlank linesComment linesLines of code
PHP341,4522,5455,421
XML102773972,372
CSS21311,261
JavaScript2125114455
SVG1800127
JSON20080
Markdown114025

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity31.38
▷ Minimum class complexity1.00
▷ Maximum class complexity291.00
Average method complexity4.08
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes26
▷ Abstract classes00.00%
▷ Concrete classes26100.00%
▷ Final classes13.85%
Methods251
▷ Static methods4417.53%
▷ Public methods17670.12%
▷ Protected methods4015.94%
▷ Private methods3513.94%
Functions10
▷ Named functions110.00%
▷ Anonymous functions990.00%
Constants8
▷ Global constants675.00%
▷ Class constants225.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
No PNG files were detected