74% live-css-preview

Code Review | Live CSS Preview

WordPress plugin Live CSS Preview scored74%from 54 tests.

About plugin

  • Plugin page: live-css-preview
  • Plugin version: 2.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-5.0
  • WordPress version: 6.3.1
  • First release: Jul 7, 2012
  • Latest release: Dec 19, 2018
  • Number of updates: 28
  • Update frequency: every 84.1 days
  • Top authors: dojodigital (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

400+ active /6,559 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼2.25ms] Passed 4 tests

Server-side resources used by Live CSS Preview
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0244.76 ▲3.18
Dashboard /wp-admin3.31 ▲0.0154.87 ▲0.14
Posts /wp-admin/edit.php3.36 ▲0.0149.43 ▼3.79
Add New Post /wp-admin/post-new.php5.89 ▲0.0189.92 ▼6.63
Media Library /wp-admin/upload.php3.23 ▲0.0137.15 ▲1.27

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Live CSS Preview
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,950 ▲20414.93 ▲0.5620.74 ▲18.4837.08 ▼3.83
Dashboard /wp-admin2,206 ▲155.86 ▲0.92102.39 ▼0.4443.06 ▼7.10
Posts /wp-admin/edit.php2,089 ▼02.01 ▲0.0235.85 ▲0.7133.72 ▼2.41
Add New Post /wp-admin/post-new.php1,534 ▲1523.18 ▼0.10682.23 ▼0.6162.39 ▲9.46
Media Library /wp-admin/upload.php1,391 ▲64.19 ▼0.03109.82 ▼6.9146.43 ▼0.81

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% 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)
Good news, no errors were detected

SRP 50% 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 fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Control' not found in wp-content/plugins/live-css-preview/wp-customize-ext.class.php:6
    • > PHP Fatal error
      Uncaught Error: Call to a member function query() on null in wp-content/plugins/live-css-preview/uninstall.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

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Screenshots: Please add images for these screenshots: #1 (live css snapshot1), #2 (live css snapshot2)
You can take inspiration from this readme.txt

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

"Live CSS Preview" version 2.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
120 characters long description:
Adds a textarea to the new Customize page that allows theme editors to write, preview & implement css code in real time.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected462 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript2731207
CSS1231139
PHP477111116

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity5.00
▷ Minimum class complexity1.00
▷ Maximum class complexity9.00
Average method complexity1.67
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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 images were found in this plugin