78% catch-themes-demo-import

Code Review | Catch Themes Demo Import

WordPress plugin Catch Themes Demo Import scored78%from 54 tests.

About plugin

  • Plugin page: catch-themes-demo...
  • Plugin version: 2.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.4
  • WordPress version: 6.3.1
  • First release: Feb 28, 2019
  • Latest release: Nov 15, 2023
  • Number of updates: 40
  • Update frequency: every 43.0 days
  • Top authors: catchthemes (87.5%)maheshmaharjan (15%)

Code review

54 tests

User reviews

1 review

Install metrics

10,000+ active /198,240 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼1.93ms] Passed 4 tests

Analyzing server-side resources used by Catch Themes Demo Import
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0738.85 ▼1.94
Dashboard /wp-admin3.36 ▲0.0648.48 ▼1.96
Posts /wp-admin/edit.php3.48 ▲0.1248.29 ▲2.20
Add New Post /wp-admin/post-new.php5.94 ▲0.0686.46 ▼5.06
Media Library /wp-admin/upload.php3.29 ▲0.0633.74 ▲1.26
Catch Themes Demo Import /wp-admin/themes.php?page=catch-themes-demo-import3.3533.78

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Catch Themes Demo Import
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲3214.22 ▼0.131.79 ▼0.0742.44 ▼2.21
Dashboard /wp-admin2,202 ▲245.62 ▲0.0483.16 ▼36.0341.71 ▼1.17
Posts /wp-admin/edit.php2,101 ▲11.98 ▼0.0336.08 ▼2.6733.82 ▼3.51
Add New Post /wp-admin/post-new.php1,538 ▲1218.48 ▼4.68604.66 ▼24.2861.23 ▲18.37
Media Library /wp-admin/upload.php1,407 ▲44.16 ▼0.04102.18 ▼3.3145.18 ▲0.81
Catch Themes Demo Import /wp-admin/themes.php?page=catch-themes-demo-import1,2122.3448.2691.83

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

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% 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
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/catch-themes-demo-import/catch-themes-demo-import.php
  • 14× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/catch-themes-demo-import/inc/ctp-tabs-removal.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI_Command' not found in wp-content/plugins/catch-themes-demo-import/inc/WPCLICommands.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'CatchThemes\\WPContentImporter2\\WXRImporter' not found in wp-content/plugins/catch-themes-demo-import/inc/WXRImporter.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/catch-themes-demo-import/inc/demo-importer.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/catch-themes-demo-import/partials/footer.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Setting' not found in wp-content/plugins/catch-themes-demo-import/inc/CustomizerOption.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'CatchThemes\\WPContentImporter2\\WPImporterLoggerCLI' not found in wp-content/plugins/catch-themes-demo-import/inc/Logger.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Importer' not found in wp-content/plugins/catch-themes-demo-import/vendor/catchthemes/wp-content-importer-v2/src/WXRImporter.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/catch-themes-demo-import/partials/sidebar.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'CatchThemes\\WPContentImporter2\\WPImporterLogger' not found in wp-content/plugins/catch-themes-demo-import/vendor/catchthemes/wp-content-importer-v2/src/WPImporterLoggerCLI.php:4

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

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
8 plugin tags: demo, widgets, redux, theme options, content...

catch-themes-demo-import/catch-themes-demo-import.php 92% from 13 tests

This is the main PHP file of "Catch Themes Demo Import" version 2.1.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 195 characters long)

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
Success! There were no dangerous files found in this plugin5,822 lines of code in 39 files:
LanguageFilesBlank linesComment linesLines of code
PHP321,1561,9244,447
CSS220630963
JavaScript46471399
Markdown19013

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity29.27
▷ Minimum class complexity1.00
▷ Maximum class complexity290.00
Average method complexity4.37
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes22
▷ Abstract classes00.00%
▷ Concrete classes22100.00%
▷ Final classes14.55%
Methods185
▷ Static methods3619.46%
▷ Public methods12366.49%
▷ Protected methods3619.46%
▷ Private methods2614.05%
Functions12
▷ Named functions975.00%
▷ Anonymous functions325.00%
Constants5
▷ Global constants360.00%
▷ Class constants240.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/free-plugin-246x116.png8.01KB3.81KB▼ 52.42%
images/premium-plugin-246x116.png9.01KB4.16KB▼ 53.83%