78% tbthemes-demo-import

Code Review | TBThemes Theme Import

WordPress plugin TBThemes Theme Import scored78%from 54 tests.

About plugin

  • Plugin page: tbthemes-demo-import
  • Plugin version: 1.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.4
  • WordPress version: 6.3.1
  • First release: Jun 2, 2020
  • Latest release: Nov 23, 2023
  • Number of updates: 37
  • Update frequency: every 34.5 days
  • Top authors: thebootstrapthemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

600+ active /18,918 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼9.40ms] Passed 4 tests

A check of server-side resources used by TBThemes Theme Import
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1140.31 ▼1.65
Dashboard /wp-admin3.43 ▲0.0845.85 ▼18.86
Posts /wp-admin/edit.php3.54 ▲0.1950.97 ▼1.48
Add New Post /wp-admin/post-new.php6.01 ▲0.1286.50 ▼15.60
Media Library /wp-admin/upload.php3.35 ▲0.1235.96 ▲3.01
Demo Import /wp-admin/themes.php?page=advanced-import3.3233.83

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 203 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts
__tbthemes_demo_import_do_redirect
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

TBThemes Theme Import: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲7914.35 ▼0.031.56 ▼0.1340.51 ▼5.40
Dashboard /wp-admin2,234 ▲575.64 ▲0.1294.23 ▲3.6943.49 ▲3.65
Posts /wp-admin/edit.php2,136 ▲361.99 ▲0.0439.90 ▼2.4539.18 ▲3.69
Add New Post /wp-admin/post-new.php1,551 ▲2523.21 ▼0.11685.85 ▲30.7356.70 ▼2.17
Media Library /wp-admin/upload.php1,439 ▲394.29 ▲0.0398.13 ▲2.7043.74 ▲2.34
Demo Import /wp-admin/themes.php?page=advanced-import8432.0327.7830.91

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • __tbthemes_demo_import_do_redirect
    • 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)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/tbthemes-demo-import/public/partials/tbthemes-demo-import-public-display.php
  • 10× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/tbthemes-demo-import/admin/templates/chic-lifestyle.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/tbthemes-demo-import/admin/templates/travel-agency-booking.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/tbthemes-demo-import/admin/templates/lifestyle-magazine.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/tbthemes-demo-import/admin/templates/relax-spa.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/tbthemes-demo-import/admin/templates/travel-tour.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/tbthemes-demo-import/admin/templates/bootstrap-fitness.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/tbthemes-demo-import/admin/templates/magazine-newspaper.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/tbthemes-demo-import/admin/templates/bootstrap-blog.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/tbthemes-demo-import/admin/templates/bootstrap-coach.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/tbthemes-demo-import/admin/templates/bootstrap-photography.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
1 plugin tags: one click theme import

tbthemes-demo-import/tbthemes-demo-import.php Passed 13 tests

Analyzing the main PHP file in "TBThemes Theme Import" version 1.4.0
99 characters long description:
This is a theme import plugin. Our plugin will help you import the theme content with just a click.

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
Good job! No executable or dangerous file extensions detected1,507 lines of code in 134 files:
LanguageFilesBlank linesComment linesLines of code
PHP212725561,316
JSON10900109
CSS25456
JavaScript273226

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity6.57
▷ Minimum class complexity1.00
▷ Maximum class complexity30.00
Average method complexity2.22
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods32
▷ Static methods515.62%
▷ Public methods2784.38%
▷ Protected methods00.00%
▷ Private methods515.62%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 0% from 2 tests

Image compression 0% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
9 PNG files occupy 2.72MB with 2.72MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
(invalid) includes/demo-data/bootstrap-fitness/free/screenshot.png558.80KB0.00KB▼ 100.00%
(invalid) includes/demo-data/travel-agency-booking/pro/screenshot.png66.80KB0.00KB▼ 100.00%
(invalid) includes/demo-data/travel-agency-booking/free/screenshot.png347.89KB0.00KB▼ 100.00%
(invalid) includes/demo-data/bootstrap-coach/pro/screenshot.png477.02KB0.00KB▼ 100.00%
(invalid) includes/demo-data/relax-spa/free/screenshot.png120.80KB0.00KB▼ 100.00%