84% bstone-demo-importer

Code Review | Bstone Demo Importer

WordPress plugin Bstone Demo Importer scored84%from 54 tests.

About plugin

  • Plugin page: bstone-demo-importer
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.2.4
  • WordPress version: 6.3.1
  • First release: Oct 24, 2019
  • Latest release: Oct 27, 2019
  • Number of updates: 3
  • Update frequency: every 1.0 days
  • Top authors: stackthemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /812 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.01MB] [CPU: ▼11.21ms] Passed 4 tests

A check of server-side resources used by Bstone Demo Importer
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.28 ▼4.38
Dashboard /wp-admin3.31 ▼0.0347.19 ▼22.93
Posts /wp-admin/edit.php3.37 ▲0.0149.92 ▼3.19
Add New Post /wp-admin/post-new.php5.90 ▲0.0188.75 ▼9.22
Media Library /wp-admin/upload.php3.24 ▲0.0033.45 ▼8.31

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Bstone Demo Importer
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.30 ▼0.071.70 ▼0.0240.10 ▲1.33
Dashboard /wp-admin2,195 ▲215.55 ▼0.0785.50 ▼6.9838.89 ▼5.93
Posts /wp-admin/edit.php2,103 ▲32.04 ▲0.0441.09 ▲2.3035.93 ▼4.72
Add New Post /wp-admin/post-new.php1,545 ▲1923.48 ▲5.89601.31 ▼97.0853.31 ▲0.26
Media Library /wp-admin/upload.php1,400 ▼04.25 ▼0.0198.60 ▲1.3543.45 ▼4.70

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
The following issues need your attention
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Setting' not found in wp-content/plugins/bstone-demo-importer/includes/importers/customize/class-oc-customize-demo-importer-setting.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Upgrader' not found in wp-content/plugins/bstone-demo-importer/includes/admin/class-demo-pack-upgrader.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Screenshots: Add an image for screenshot #3 (Finally, Import the Demo with just one click.)
You can take inspiration from this readme.txt

bstone-demo-importer/bstone-demo-importer.php Passed 13 tests

The main PHP script in "Bstone Demo Importer" version 1.0.1 is automatically included on every request by WordPress
82 characters long description:
Import Bstone theme demos content, widgets and theme settings with just one click.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected4,829 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP156889963,298
JavaScript73863581,263
Sass2430251
XML14315
CSS2002

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity56.00
▷ Minimum class complexity1.00
▷ Maximum class complexity247.00
Average method complexity6.71
▷ Minimum method complexity1.00
▷ Maximum method complexity50.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes218.18%
Methods106
▷ Static methods76.60%
▷ Public methods9387.74%
▷ Protected methods10.94%
▷ Private methods1211.32%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.00%
▷ Class constants00.00%
▷ Public constants00.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
There are no PNG files in this plugin