78% theme-canary-demo-import

Code Review | Theme Canary Demo Importer

WordPress plugin Theme Canary Demo Importer scored78%from 54 tests.

About plugin

  • Plugin page: theme-canary-demo...
  • Plugin version: 1.0.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.2
  • WordPress version: 6.3.1
  • First release: Apr 29, 2023
  • Latest release: Sep 7, 2023
  • Number of updates: 15
  • Update frequency: every 8.8 days
  • Top authors: themecanary (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /351 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
Installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼2.89ms] Passed 4 tests

Server-side resources used by Theme Canary Demo Importer
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0741.42 ▼1.42
Dashboard /wp-admin3.37 ▲0.0646.46 ▼6.85
Posts /wp-admin/edit.php3.48 ▲0.1249.61 ▲1.40
Add New Post /wp-admin/post-new.php5.97 ▲0.0894.26 ▼4.39
Media Library /wp-admin/upload.php3.29 ▲0.0638.42 ▲1.10

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 52 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Theme Canary Demo Importer
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,940 ▲19413.61 ▼0.988.96 ▲7.2037.76 ▼9.79
Dashboard /wp-admin2,235 ▲465.86 ▼0.0497.71 ▼9.9743.64 ▲0.10
Posts /wp-admin/edit.php2,123 ▲312.10 ▲0.1141.78 ▲2.4740.95 ▲0.61
Add New Post /wp-admin/post-new.php1,537 ▲423.49 ▲0.34604.75 ▼49.1460.65 ▼7.77
Media Library /wp-admin/upload.php1,422 ▲374.36 ▲0.1796.00 ▼8.2342.46 ▼2.36

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

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)
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/theme-canary-demo-import/public/partials/demo-importer-public-display.php
    • > /wp-content/plugins/theme-canary-demo-import/theme-canary-demo-importer.php
    • > /wp-content/plugins/theme-canary-demo-import/admin/partials/admin-display.php
  • 8× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_theme() in wp-content/plugins/theme-canary-demo-import/includes/demo-importer.php:213
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/theme-canary-demo-import/admin/demo-importer-admin.php:124
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/theme-canary-demo-import/includes/files/magpage-pro.php:40
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/theme-canary-demo-import/includes/files/magpage.php:35
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/theme-canary-demo-import/includes/files/canary-led-pro.php:174
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/theme-canary-demo-import/includes/files/snapfolio-pro.php:44
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/theme-canary-demo-import/includes/files/canary-led.php:139
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/theme-canary-demo-import/includes/files/snapfolio.php:37

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Donate link: Invalid url: "themecanary.com/plugins/theme-canary-demo-import"
Please take inspiration from this readme.txt

theme-canary-demo-import/theme-canary-demo-importer.php 85% from 13 tests

"Theme Canary Demo Importer" version 1.0.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 147 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("theme-canary-demo-import.php" instead of "theme-canary-demo-importer.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin32,687 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
XML91,1881,25131,745
PHP18218558829
CSS218873
JavaScript262940

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity1.43
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.13
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods23
▷ Static methods28.70%
▷ Public methods1878.26%
▷ Protected methods00.00%
▷ Private methods521.74%
Functions21
▷ Named functions21100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG files were detected