78% live-theme-preview

Code Review | Live Theme Preview

WordPress plugin Live Theme Preview scored78%from 54 tests.

About plugin

  • Plugin page: live-theme-preview
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-3.5
  • WordPress version: 6.3.1
  • First release: Nov 2, 2012
  • Latest release: Feb 20, 2013
  • Number of updates: 13
  • Update frequency: every 8.5 days
  • Top authors: Mike_Cowobo (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

30+ active /5,185 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.02MB] [CPU: ▼0.86ms] Passed 4 tests

A check of server-side resources used by Live Theme Preview
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.14 ▲0.14
Dashboard /wp-admin3.33 ▲0.0246.83 ▼6.46
Posts /wp-admin/edit.php3.44 ▲0.0850.01 ▼4.05
Add New Post /wp-admin/post-new.php5.91 ▲0.0298.65 ▲6.92
Media Library /wp-admin/upload.php3.25 ▲0.0241.52 ▲7.44
Themes 3 /wp-admin/themes.php?live_themes=13.2226.78

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 20 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Live Theme Preview
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲3313.31 ▼1.501.85 ▼0.2941.02 ▼2.71
Dashboard /wp-admin2,225 ▲225.86 ▼0.03100.68 ▼0.8241.73 ▼1.87
Posts /wp-admin/edit.php2,104 ▲42.01 ▼0.0535.23 ▼1.4234.02 ▼1.43
Add New Post /wp-admin/post-new.php1,543 ▼218.24 ▼4.86656.43 ▼6.9465.46 ▼5.07
Media Library /wp-admin/upload.php1,404 ▲44.26 ▲0.03112.26 ▲12.3147.22 ▲4.78
Themes 3 /wp-admin/themes.php?live_themes=11,1532.6245.0262.34

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

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/themes.php?live_themes=1
    • > Notice in wp-admin/includes/class-wp-site-health.php+94
    Trying to get property 'id' of non-object

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
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/live-theme-preview/lib/live-admin/live-admin-template.php:5

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 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === live-theme-preview === )
The official readme.txt is a good inspiration

live-theme-preview/live-theme-preview.php Passed 13 tests

The main PHP file in "Live Theme Preview" ver. 1.0.2 adds more information about the plugin and also serves as the entry point for this plugin
105 characters long description:
Live Theme Preview allows users to preview themes on their website before customizing or activating them.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected1,439 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP10382320974
JavaScript47428250
CSS4484215

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity13.50
▷ Minimum class complexity2.00
▷ Maximum class complexity40.00
Average method complexity2.35
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods74
▷ Static methods45.41%
▷ Public methods5878.38%
▷ Protected methods1114.86%
▷ Private methods56.76%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants19
▷ Global constants19100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected