94% jquery-pin-it-button-for-images

Code Review | jQuery Pin It Button for Images

WordPress plugin jQuery Pin It Button for Images scored 94% from 54 tests.

About plugin

  • Plugin page: jquery-pin-it-but...
  • Plugin version: 3.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.0-5.5.1
  • WordPress version: 5.8.1
  • First release: Dec 3, 2012
  • Latest release: Oct 1, 2020
  • Number of updates: 248
  • Update frequency: every 11.5 days
  • Top authors: mrsztuczkens (100%)

Code review

54 tests

User reviews

305 reviews

Install metrics

30,000+ active / 679,863 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.27MB] [CPU: ▼140.50ms] Passed 4 tests

A check of server-side resources used by jQuery Pin It Button for Images
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.93 ▲0.2238.55 ▲10.91
Dashboard /wp-admin3.39 ▲0.3350.17 ▲5.22
Posts /wp-admin/edit.php3.44 ▲0.3347.41 ▲0.93
Add New Post /wp-admin/post-new.php5.69 ▲0.2588.76 ▼570.74
Media Library /wp-admin/upload.php3.27 ▲0.2735.94 ▲2.61
jQuery Pin It Button For Images Lite /wp-admin/options-general.php?page=jpibfi_settings3.2839.38

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 48 new files
Database: no new tables, 1 new option
New WordPress options
jpibfi_version

Browser metrics Passed 4 tests

An overview of browser requirements for jQuery Pin It Button for Images
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,808 ▲21316.23 ▲0.6617.23 ▲8.5049.16 ▲2.58
Dashboard /wp-admin2,978 ▲446.04 ▼0.01140.85 ▼8.08116.63 ▼1.54
Posts /wp-admin/edit.php2,744 ▲52.69 ▲0.0074.08 ▲4.1198.11 ▲3.72
Add New Post /wp-admin/post-new.php1,728 ▲12417.01 ▼1.88392.51 ▲7.76122.86 ▲6.60
Media Library /wp-admin/upload.php1,815 ▲55.03 ▲0.01174.32 ▲19.09120.56 ▼6.41
jQuery Pin It Button For Images Lite /wp-admin/options-general.php?page=jpibfi_settings1,5184.9596.1190.93

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstaller ran successfully

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)
Even though everything seems fine, this is not an exhaustive test

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
Please take a closer look at the following
  • 7× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'JPIBFI_Settings_Tab' not found in wp-content/plugins/jquery-pin-it-button-for-images/includes/admin/settings/jpibfi-import-export-settings.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'JPIBFI_Options' not found in wp-content/plugins/jquery-pin-it-button-for-images/includes/includes/options/jpibfi-advanced-options.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'JPIBFI_Settings_Base' not found in wp-content/plugins/jquery-pin-it-button-for-images/includes/admin/settings/jpibfi-advanced-settings.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'JPIBFI_Settings_Base' not found in wp-content/plugins/jquery-pin-it-button-for-images/includes/admin/settings/jpibfi-visual-settings.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'JPIBFI_Options' not found in wp-content/plugins/jquery-pin-it-button-for-images/includes/includes/options/jpibfi-selection-options.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'JPIBFI_Options' not found in wp-content/plugins/jquery-pin-it-button-for-images/includes/includes/options/jpibfi-visual-options.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'JPIBFI_Settings_Base' not found in wp-content/plugins/jquery-pin-it-button-for-images/includes/admin/settings/jpibfi-selection-settings.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Tags: There are too many tags (11 tag instead of maximum 10)
You can take inspiration from this readme.txt

jquery-pin-it-button-for-images/jquery-pin-it-button-for-images.php Passed 13 tests

"jQuery Pin It Button for Images" version 3.0.6's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
81 characters long description:
Highlights images on hover and adds a "Pin It" button over them for easy pinning.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin2,131 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
PHP294741842,112
SVG10015
CSS2002
JavaScript2002

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity12.33
▷ Minimum class complexity1.00
▷ Maximum class complexity73.00
Average method complexity3.09
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes24
▷ Abstract classes416.67%
▷ Concrete classes2083.33%
▷ Final classes15.00%
Methods134
▷ Static methods21.49%
▷ Public methods10276.12%
▷ Protected methods32.24%
▷ Private methods2921.64%
Functions2
▷ Named functions2100.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
4 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/settings_link_pro.png4.39KB2.62KB▼ 40.23%
images/settings_tabs.png4.55KB3.02KB▼ 33.64%
css/images/pinit-button.png5.87KB2.18KB▼ 62.85%
images/settings_link.png7.18KB4.08KB▼ 43.17%