78% crafthemes-demo-import

Code Review | Crafthemes Demo Import

WordPress plugin Crafthemes Demo Import scored78%from 54 tests.

About plugin

  • Plugin page: crafthemes-demo-i...
  • Plugin version: 3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1
  • WordPress version: 6.3.1
  • First release: Sep 27, 2019
  • Latest release: Mar 29, 2023
  • Number of updates: 76
  • Update frequency: every 16.8 days
  • Top authors: aruphash (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active /33,837 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.75MB] [CPU: ▲266.12ms] 75% from 4 tests

This is a short check of server-side resources used by Crafthemes Demo Import
Please take the time to fix the following items
  • Extra CPU: Extra CPU usage should be kept under 200.00ms (currently 266.12ms on /wp-admin/upload.php)
PageMemory (MB)CPU Time (ms)
Home /4.20 ▲0.74320.34 ▲274.99
Dashboard /wp-admin4.11 ▲0.80323.86 ▲273.78
Posts /wp-admin/edit.php4.17 ▲0.81327.16 ▲272.65
Add New Post /wp-admin/post-new.php6.63 ▲0.74337.92 ▲243.07
Media Library /wp-admin/upload.php3.95 ▲0.72332.59 ▲293.72

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 53 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

Crafthemes Demo Import: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,971 ▲22515.03 ▲0.722.04 ▲0.0542.82 ▼0.75
Dashboard /wp-admin2,362 ▲1746.45 ▲0.55133.01 ▲12.6345.01 ▲1.64
Posts /wp-admin/edit.php2,268 ▲1793.29 ▲1.2955.98 ▲19.0735.26 ▼0.87
Add New Post /wp-admin/post-new.php1,530 ▼1221.22 ▲2.97636.80 ▲10.3237.48 ▼11.85
Media Library /wp-admin/upload.php1,404 ▲134.10 ▼0.0978.56 ▼26.5342.13 ▼3.96

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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
The following issues need your attention
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/crafthemes-demo-import/inc/CTAdditionals.php
    • > /wp-content/plugins/crafthemes-demo-import/crafthemes-demo-import.php
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/crafthemes-demo-import/inc/misc.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI_Command' not found in wp-content/plugins/crafthemes-demo-import/inc/WPCLICommands.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'ProteusThemes\\WPContentImporter2\\WPImporterLogger' not found in wp-content/plugins/crafthemes-demo-import/vendor/proteusthemes/wp-content-importer-v2/src/WPImporterLoggerCLI.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Setting' not found in wp-content/plugins/crafthemes-demo-import/inc/CustomizerOption.php:14
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/crafthemes-demo-import/views/plugin-page.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Importer' not found in wp-content/plugins/crafthemes-demo-import/vendor/proteusthemes/wp-content-importer-v2/src/WXRImporter.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'ProteusThemes\\WPContentImporter2\\WXRImporter' not found in wp-content/plugins/crafthemes-demo-import/inc/WXRImporter.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'ProteusThemes\\WPContentImporter2\\WPImporterLoggerCLI' not found in wp-content/plugins/crafthemes-demo-import/inc/Logger.php:10

User-side errors Passed 1 test

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

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
8 plugin tags: widgets, settings, redux, content, import...

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

The primary PHP file in "Crafthemes Demo Import" version 3.1 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected5,238 lines of code in 49 files:
LanguageFilesBlank linesComment linesLines of code
PHP421,0921,8484,558
CSS28428345
JavaScript26268257
JSON20064
Markdown111014

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity29.10
▷ Minimum class complexity1.00
▷ Maximum class complexity290.00
Average method complexity4.24
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes20
▷ Abstract classes00.00%
▷ Concrete classes20100.00%
▷ Final classes15.00%
Methods174
▷ Static methods3620.69%
▷ Public methods11264.37%
▷ Protected methods3620.69%
▷ Private methods2614.94%
Functions27
▷ Named functions2281.48%
▷ Anonymous functions518.52%
Constants6
▷ Global constants466.67%
▷ Class constants233.33%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/logo-1x1.png0.81KB0.89KB0.00%