79% di-themes-demo-site-importer

Code Review | Di Themes Demo Site Importer

WordPress plugin Di Themes Demo Site Importer scored79%from 54 tests.

About plugin

  • Plugin page: di-themes-demo-si...
  • Plugin version: 1.1.7
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.3
  • WordPress version: 6.3.1
  • First release: Jun 16, 2019
  • Latest release: Sep 23, 2023
  • Number of updates: 22
  • Update frequency: every 71.0 days
  • Top authors: dithemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active /60,657 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.00MB] [CPU: ▼7.06ms] Passed 4 tests

Analyzing server-side resources used by Di Themes Demo Site Importer
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.61 ▼0.15
Dashboard /wp-admin3.31 ▼0.0346.63 ▼13.07
Posts /wp-admin/edit.php3.36 ▲0.0143.71 ▲0.97
Add New Post /wp-admin/post-new.php5.89 ▲0.0183.59 ▼15.73
Media Library /wp-admin/upload.php3.23 ▲0.0135.70 ▲0.70

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 122 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Di Themes Demo Site Importer
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.24 ▼1.011.91 ▲0.0645.45 ▲3.05
Dashboard /wp-admin2,206 ▲154.85 ▼1.18111.69 ▲4.2641.65 ▲0.12
Posts /wp-admin/edit.php2,089 ▼02.03 ▲0.0536.93 ▼2.5131.58 ▼6.22
Add New Post /wp-admin/post-new.php1,533 ▼923.24 ▲4.97655.31 ▲56.3851.18 ▼8.22
Media Library /wp-admin/upload.php1,388 ▼04.17 ▼0.0995.62 ▼3.2340.96 ▼3.49

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget

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)
Even though everything seems fine, this is not an exhaustive test

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
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/di-themes-demo-site-importer/di-themes-demo-site-importer.php
    • > /wp-content/plugins/di-themes-demo-site-importer/inc/ocdi/one-click-demo-import.php
  • 14× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Setting' not found in wp-content/plugins/di-themes-demo-site-importer/inc/ocdi/inc/CustomizerOption.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/di-themes-demo-site-importer/inc/di-themes/di-ecommerce/import-settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/di-themes-demo-site-importer/inc/di-themes/di-responsive/import-settings.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'AwesomeMotive\\WPContentImporter2\\WXRImporter' not found in wp-content/plugins/di-themes-demo-site-importer/inc/ocdi/inc/WXRImporter.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/di-themes-demo-site-importer/inc/di-themes/di-restaurant/import-settings.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'AwesomeMotive\\WPContentImporter2\\WPImporterLogger' not found in wp-content/plugins/di-themes-demo-site-importer/inc/ocdi/vendor/awesomemotive/wp-content-importer-v2/src/WPImporterLoggerCLI.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/di-themes-demo-site-importer/inc/di-themes/di-blog/import-settings.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'AwesomeMotive\\WPContentImporter2\\WXRImporter' not found in wp-content/plugins/di-themes-demo-site-importer/inc/ocdi/vendor/awesomemotive/wp-content-importer-v2/src/Importer.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI_Command' not found in wp-content/plugins/di-themes-demo-site-importer/inc/ocdi/inc/WPCLICommands.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'AwesomeMotive\\WPContentImporter2\\WPImporterLoggerCLI' not found in wp-content/plugins/di-themes-demo-site-importer/inc/ocdi/inc/Logger.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: website, di themes, demo, theme, import

di-themes-demo-site-importer/di-themes-demo-site-importer.php Passed 13 tests

The main PHP file in "Di Themes Demo Site Importer" ver. 1.1.7 adds more information about the plugin and also serves as the entry point for this plugin
52 characters long description:
Import demo website of theme developed by Di Themes.

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
There were no executable files found in this plugin149,426 lines of code in 59 files:
LanguageFilesBlank linesComment linesLines of code
XML6540621140,192
PHP441,9182,8737,606
CSS318121914
JavaScript3197136611
JSON20080
Markdown113023

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity36.13
▷ Minimum class complexity1.00
▷ Maximum class complexity290.00
Average method complexity5.02
▷ Minimum method complexity1.00
▷ Maximum method complexity50.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes31
▷ Abstract classes00.00%
▷ Concrete classes31100.00%
▷ Final classes13.23%
Methods272
▷ Static methods4717.28%
▷ Public methods20274.26%
▷ Protected methods4014.71%
▷ Private methods3011.03%
Functions19
▷ Named functions1684.21%
▷ Anonymous functions315.79%
Constants13
▷ Global constants1184.62%
▷ Class constants215.38%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin