78% theme-demo-import

Code Review | Theme Demo Import

WordPress plugin Theme Demo Import scored78%from 54 tests.

About plugin

  • Plugin page: theme-demo-import
  • Plugin version: 1.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.1
  • WordPress version: 6.3.1
  • First release: Oct 28, 2016
  • Latest release: Nov 3, 2022
  • Number of updates: 20
  • Update frequency: every 109.9 days
  • Top authors: themely (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10,000+ active /225,543 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.47MB] [CPU: ▲2.90ms] Passed 4 tests

Analyzing server-side resources used by Theme Demo Import
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.97 ▲0.5043.17 ▲2.71
Dashboard /wp-admin3.80 ▲0.5051.84 ▲0.50
Posts /wp-admin/edit.php3.86 ▲0.5051.97 ▲6.69
Add New Post /wp-admin/post-new.php6.32 ▲0.4393.42 ▲3.79
Media Library /wp-admin/upload.php3.66 ▲0.4338.45 ▲4.59
Import Demo Content /wp-admin/themes.php?page=theme-demo-import3.7834.93

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 17 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Theme Demo Import
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4713.23 ▼1.041.73 ▼0.4145.02 ▼0.81
Dashboard /wp-admin2,213 ▲254.87 ▼0.05107.96 ▲4.5040.67 ▼4.52
Posts /wp-admin/edit.php2,096 ▲72.06 ▲0.0341.45 ▲5.2535.26 ▼1.54
Add New Post /wp-admin/post-new.php1,536 ▲123.07 ▼0.46593.80 ▼99.1848.41 ▼5.32
Media Library /wp-admin/upload.php1,392 ▲74.22 ▼0.0396.15 ▼7.2740.87 ▼2.71
Import Demo Content /wp-admin/themes.php?page=theme-demo-import8761.9639.4761.22

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
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
Please fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/theme-demo-import/theme-demo-import.php
  • 11× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Setting' not found in wp-content/plugins/theme-demo-import/inc/class-tdi-customizer-option.php:12
    • > PHP Warning
      Use of undefined constant TDI_PATH - assumed 'TDI_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/theme-demo-import/inc/class-tdi-logger.php on line 9
    • > PHP Fatal error
      require(): Failed opening required 'TDI_PATHinc/class-tdi-helpers.php' (include_path='.:/usr/share/php') in wp-content/plugins/theme-demo-import/inc/class-tdi-main.php on line 9
    • > PHP Warning
      require(TDI_PATHinc/importer/class-wxr-importer.php): failed to open stream: No such file or directory in wp-content/plugins/theme-demo-import/inc/class-tdi-wxr-importer.php on line 11
    • > PHP Warning
      require(TDI_PATHinc/importer/class-logger.php): failed to open stream: No such file or directory in wp-content/plugins/theme-demo-import/inc/class-tdi-logger.php on line 9
    • > PHP Warning
      Use of undefined constant TDI_PATH - assumed 'TDI_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/theme-demo-import/inc/class-tdi-main.php on line 9
    • > PHP Fatal error
      require(): Failed opening required 'TDI_PATHinc/importer/class-logger.php' (include_path='.:/usr/share/php') in wp-content/plugins/theme-demo-import/inc/class-tdi-logger.php on line 9
    • > PHP Fatal error
      require(): Failed opening required 'TDI_PATHinc/importer/class-wxr-importer.php' (include_path='.:/usr/share/php') in wp-content/plugins/theme-demo-import/inc/class-tdi-wxr-importer.php on line 11
    • > PHP Warning
      Use of undefined constant TDI_PATH - assumed 'TDI_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/theme-demo-import/inc/class-tdi-wxr-importer.php on line 11
    • > PHP Fatal error
      Uncaught Error: Class 'HM_WP_Importer_Logger' not found in wp-content/plugins/theme-demo-import/inc/importer/class-logger-cli.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 96% from 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
7 plugin tags: theme, import, settings, data, widgets...

theme-demo-import/theme-demo-import.php 92% from 13 tests

"Theme Demo Import" version 1.1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 158 characters long)

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
No dangerous file extensions were detected2,644 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP127631,2062,503
CSS125780
JavaScript112761

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity38.18
▷ Minimum class complexity1.00
▷ Maximum class complexity262.00
Average method complexity4.73
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes19.09%
Methods110
▷ Static methods2320.91%
▷ Public methods5751.82%
▷ Protected methods3430.91%
▷ Private methods1917.27%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants6
▷ Global constants466.67%
▷ Class constants233.33%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected