10% leniy-tweaks

Code Review | Leniy Tweaks

WordPress plugin Leniy Tweaks scored 10% from 54 tests.

About plugin

  • Plugin page: leniy-tweaks
  • Plugin version: 0.6.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.6
  • WordPress version: 5.8.1
  • First release: Jun 4, 2013
  • Latest release: Aug 17, 2016
  • Number of updates: 29
  • Update frequency: every 40.3 days
  • Top authors: leniy (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 1,041 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/leniy-tweaks/widgets/leniy-widget-blogstat.php+7
    Methods with the same name as their class will not be constructors in a future version of PHP; Leniy_Blogstat_Widget has a deprecated constructor

Server metrics [RAM: ▼1.81MB] [CPU: ▼188.25ms] Passed 4 tests

A check of server-side resources used by Leniy Tweaks
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /1.82 ▼1.0111.31 ▼23.45
Dashboard /wp-admin1.84 ▼1.225.25 ▼43.13
Posts /wp-admin/edit.php1.84 ▼1.275.98 ▼37.31
Add New Post /wp-admin/post-new.php1.84 ▼3.596.42 ▼649.11
Media Library /wp-admin/upload.php1.84 ▼1.165.95 ▼21.70

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 32 new files
Database: no new tables, 4 new options
New WordPress options
widget_leniy_widget_announce
widget_leniy_widget_socialbox
widget_leniy_widget_blogstat
widget_leniy_widget_postlist

Browser metrics Passed 4 tests

Leniy Tweaks: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,724 ▲12815.85 ▲0.279.74 ▼0.6248.60 ▲1.69
Dashboard /wp-admin2,985 ▲485.92 ▼0.03132.09 ▼15.56132.23 ▲16.63
Posts /wp-admin/edit.php2,776 ▲372.70 ▼0.0264.58 ▼0.2495.92 ▲5.42
Add New Post /wp-admin/post-new.php1,688 ▲518.91 ▲0.21374.09 ▲21.46106.82 ▼4.95
Media Library /wp-admin/upload.php1,769 ▼415.01 ▼0.02127.86 ▼44.75136.33 ▼19.85

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/leniy-tweaks/widgets/leniy-widget-blogstat.php+7
    Methods with the same name as their class will not be constructors in a future version of PHP; Leniy_Blogstat_Widget has a deprecated constructor
  • This plugin does not fully uninstall, leaving 4 options in the database
    • widget_leniy_widget_socialbox
    • widget_leniy_widget_postlist
    • widget_leniy_widget_blogstat
    • widget_leniy_widget_announce

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 11× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/leniy-tweaks/leniy_fixed_adminmenuwrap/main.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/leniy-tweaks/widgets/leniy-widget-socialbox.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/leniy-tweaks/leniy_replyview/main.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/leniy-tweaks/widgets/leniy-widget-announce.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/leniy-tweaks/leniy.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/leniy-tweaks/inc/leniy_admin_menu.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/leniy-tweaks/widgets/leniy-widget-blogstat.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/leniy-tweaks/widgets/leniy-widget-postlist.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/leniy-tweaks/leniy_local_avatar/main.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/leniy-tweaks/widgets/leniy-widget-blogstat.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: tweaks, stat, clean, comments, clear

leniy-tweaks/leniy.php 85% from 13 tests

This is the main PHP file of "Leniy Tweaks" version 0.6.7, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("leniy-tweaks.php" instead of "leniy.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
Success! There were no dangerous files found in this plugin418 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP1210057418

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity4.25
▷ Minimum class complexity2.00
▷ Maximum class complexity6.00
Average method complexity1.81
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
19 PNG files occupy 0.21MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
leniy_local_avatar/cache/d7a973c7dab26985da5f961be7b7448050.png2.78KB1.98KB▼ 28.70%
widgets/socialboximg/source/136x136/email.png17.57KB4.90KB▼ 72.10%
widgets/socialboximg/source/54x54/rss.png8.40KB2.32KB▼ 72.38%
widgets/socialboximg/source/136x136/qqweibo.png10.09KB4.85KB▼ 51.93%
widgets/socialboximg/source/136x136/sinaweibo.png18.37KB5.15KB▼ 71.95%