84% swift-demo-import

Code Review | Swift Demo Import

WordPress plugin Swift Demo Import scored84%from 54 tests.

About plugin

  • Plugin page: swift-demo-import
  • Plugin version: 2.0.6
  • PHP compatiblity: 5.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0
  • WordPress version: 6.3.1
  • First release: May 15, 2018
  • Latest release: Jun 5, 2022
  • Number of updates: 14
  • Update frequency: every 110.9 days
  • Top authors: bnayawpguy (100%)

Code review

54 tests

User reviews

1 review

Install metrics

500+ active /12,143 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.27MB] [CPU: ▲0.97ms] Passed 4 tests

A check of server-side resources used by Swift Demo Import
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.2742.27 ▲4.80
Dashboard /wp-admin3.57 ▲0.2650.16 ▼4.04
Posts /wp-admin/edit.php3.68 ▲0.3246.99 ▲1.21
Add New Post /wp-admin/post-new.php6.17 ▲0.2896.02 ▲8.02
Media Library /wp-admin/upload.php3.49 ▲0.2637.78 ▲1.91
Swift Demo Import /wp-admin/themes.php?page=sdi-demo-import3.4632.12

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Swift Demo Import
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲8013.71 ▼0.651.73 ▼0.0344.61 ▲0.40
Dashboard /wp-admin2,221 ▲424.98 ▼0.94107.23 ▼4.0035.75 ▼11.94
Posts /wp-admin/edit.php2,104 ▲122.28 ▲0.3034.77 ▼7.1235.10 ▲0.90
Add New Post /wp-admin/post-new.php1,528 ▼923.11 ▲0.05595.59 ▼96.2757.72 ▲2.73
Media Library /wp-admin/upload.php1,406 ▲184.31 ▲0.1299.31 ▲1.0942.46 ▼6.29
Swift Demo Import /wp-admin/themes.php?page=sdi-demo-import8111.7825.7826.60

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Importer' not found in wp-content/plugins/swift-demo-import/wordpress-importer/class-wp-import.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/swift-demo-import/import_config.php:581
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Setting' not found in wp-content/plugins/swift-demo-import/classes/class-customizer-option.php:8

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
6 plugin tags: content, one click import, mysticalthemes, import, widgets...

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

The primary PHP file in "Swift Demo Import" version 2.0.6 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Domain Path: The domain path folder was not found ("/languages/")

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
Everything looks great! No dangerous files found in this plugin6,641 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP147436583,890
JavaScript25558512,304
CSS1781447

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity46.43
▷ Minimum class complexity1.00
▷ Maximum class complexity198.00
Average method complexity6.20
▷ Minimum method complexity1.00
▷ Maximum method complexity50.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes214.29%
Methods121
▷ Static methods1411.57%
▷ Public methods11393.39%
▷ Protected methods32.48%
▷ Private methods54.13%
Functions6
▷ Named functions466.67%
▷ Anonymous functions233.33%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin