10% php-liquid

Code Review | PHP Liquid

WordPress plugin PHP Liquid scored10%from 54 tests.

About plugin

  • Plugin page: php-liquid
  • Plugin version: 2.7.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.5.1
  • WordPress version: 6.3.1
  • First release: Oct 3, 2012
  • Latest release: May 22, 2013
  • Number of updates: 69
  • Update frequency: every 3.4 days
  • Top authors: MMDeveloper (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,900 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/php-liquid/tinymce/tinymce.php+12
    Methods with the same name as their class will not be constructors in a future version of PHP; add_php_liquid_sliders_button has a deprecated constructor

Server metrics [RAM: ▼1.85MB] [CPU: ▼61.20ms] Passed 4 tests

Analyzing server-side resources used by PHP Liquid
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.18 ▼1.316.34 ▼36.42
Dashboard /wp-admin2.20 ▼1.186.55 ▼60.95
Posts /wp-admin/edit.php2.20 ▼1.196.66 ▼42.93
Add New Post /wp-admin/post-new.php2.20 ▼3.726.37 ▼104.50
Media Library /wp-admin/upload.php2.20 ▼1.066.01 ▼29.81

Server storage [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: no files
Database: 3 new tables, 10 new options
New tables
wp_php_liquid_sliders
wp_php_liquid_variables
wp_php_liquid_slides
New WordPress options
widget_theysaidso_widget
widget_recent-posts
php_liquid_ckeditor_enabled
db_upgraded
php_liquid_version
php_liquid_slider_css
can_compress_scripts
theysaidso_admin_options
php_liquid_application_js
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for PHP Liquid
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,022 ▲27614.42 ▼0.1613.39 ▲11.7744.81 ▲2.79
Dashboard /wp-admin2,234 ▲464.85 ▼0.08107.06 ▲6.2039.04 ▼2.41
Posts /wp-admin/edit.php2,117 ▲282.00 ▼0.0536.06 ▼4.1836.32 ▲1.39
Add New Post /wp-admin/post-new.php1,560 ▲3222.98 ▲4.96677.76 ▲55.2448.61 ▼6.16
Media Library /wp-admin/upload.php1,416 ▲284.22 ▼0.00102.67 ▲4.4844.41 ▼1.40

Uninstaller [IO: ✅] [DB: ▲0.01MB] 25% from 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/php-liquid/tinymce/tinymce.php+12
    Methods with the same name as their class will not be constructors in a future version of PHP; add_php_liquid_sliders_button has a deprecated constructor
  • The plugin did not uninstall successfully, leaving 3 tables in the database
    • wp_php_liquid_variables
    • wp_php_liquid_slides
    • wp_php_liquid_sliders
  • Zombie WordPress options detected upon uninstall: 10 options
    • php_liquid_slider_css
    • widget_recent-posts
    • php_liquid_version
    • can_compress_scripts
    • php_liquid_application_js
    • php_liquid_ckeditor_enabled
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

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)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 52× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/php-liquid/tinymce/window.php
    • > /wp-content/plugins/php-liquid/harrydeluxe-php-liquid/test/simpletest/test/support/passing_test.php
    • > /wp-content/plugins/php-liquid/harrydeluxe-php-liquid/test/simpletest/test/reflection_php4_test.php
    • > /wp-content/plugins/php-liquid/harrydeluxe-php-liquid/test/simpletest/test/xml_test.php
    • > /wp-content/plugins/php-liquid/slider/slidecss.php
    • > /wp-content/plugins/php-liquid/harrydeluxe-php-liquid/test/simpletest/test/shell_test.php
    • > /wp-content/plugins/php-liquid/harrydeluxe-php-liquid/test/simpletest/test/exceptions_test.php
    • > /wp-content/plugins/php-liquid/harrydeluxe-php-liquid/test/simpletest/test/all_tests.php
    • > /wp-content/plugins/php-liquid/harrydeluxe-php-liquid/test/test.php
    • > /wp-content/plugins/php-liquid/harrydeluxe-php-liquid/test/simpletest/test/simpletest_test.php
  • 128× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'LiquidDecisionBlock' not found in wp-content/plugins/php-liquid/harrydeluxe-php-liquid/lib/Tag/LiquidTagIf.class.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_register_style() in wp-content/plugins/php-liquid/php_liquid_applicationjs.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/php-liquid/tinymce/tinymce.php:27
    • > E_USER_NOTICE
      Ouch! in wp-content/plugins/php-liquid/harrydeluxe-php-liquid/test/simpletest/test/errors_test.php on line 72
    • > PHP Fatal error
      Uncaught ArgumentCountError: Too few arguments to function MockDummyInterface::anotherMethod(), 0 passed in wp-content/plugins/php-liquid/harrydeluxe-php-liquid/test/simpletest/test/interfaces_test.php on line 34 and exactly 1 expected in wp-content/plugins/php-liquid/harrydeluxe-php-liquid/test/simpletest/mock_objects.php(1311) : eval()'d code:10
    • > PHP Warning
      include_once(wp-content/plugins/php-liquid/harrydeluxe-php-liquid/test/simpletest/test/arguments_test.php): failed to open stream: No such file or directory in wp-content/plugins/php-liquid/harrydeluxe-php-liquid/test/simpletest/test_case.php on line 381
    • > E_WARNING
      preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in wp-content/plugins/php-liquid/harrydeluxe-php-liquid/lib/LiquidStandardFilters.class.php on line 74
    • > PHP Parse error
      syntax error, unexpected 'new' (T_NEW) in wp-content/plugins/php-liquid/harrydeluxe-php-liquid/test/simpletest/detached.php on line 56
    • > PHP Warning
      include_once(wp-content/plugins/php-liquid/harrydeluxe-php-liquid/test/simpletest/test/arguments_test.php): failed to open stream: No such file or directory in wp-content/plugins/php-liquid/harrydeluxe-php-liquid/test/simpletest/test_case.php on line 381
    • > PHP Fatal error
      Uncaught Error: Class 'LiquidTag' not found in wp-content/plugins/php-liquid/harrydeluxe-php-liquid/lib/Tag/LiquidTagIncrement.class.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === php-liquid === )
Please take inspiration from this readme.txt

php-liquid/php_liquid.php 92% from 13 tests

The entry point to "PHP Liquid" version 2.7.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("php-liquid.php" instead of "php_liquid.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected34,316 lines of code in 194 files:
LanguageFilesBlank linesComment linesLines of code
PHP1564,23911,32222,629
HTML25308011,286
CSS400250
JavaScript81842130
Markdown118021

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity3.98
▷ Minimum class complexity1.00
▷ Maximum class complexity57.00
Average method complexity1.49
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces8
Traits0
Classes437
▷ Abstract classes81.83%
▷ Concrete classes42998.17%
▷ Final classes00.00%
Methods2,737
▷ Static methods672.45%
▷ Public methods2,46790.14%
▷ Protected methods2308.40%
▷ Private methods401.46%
Functions26
▷ Named functions26100.00%
▷ Anonymous functions00.00%
Constants38
▷ Global constants38100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 compressed PNG files occupy 0.01MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
tinymce/images/slide.png1.09KB1.23KB0.00%
images/slide-controls.png0.72KB0.88KB0.00%
images/arrows.png4.12KB2.77KB▼ 32.71%