84% dynamic-pin-it-button-on-image-hover

Code Review | Dynamic Pin It Button On Image Hover

WordPress plugin Dynamic Pin It Button On Image Hover scored84%from 54 tests.

About plugin

  • Plugin page: dynamic-pin-it-bu...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.2
  • WordPress version: 6.3.1
  • First release: May 9, 2023
  • Latest release: May 9, 2023
  • Number of updates: 7
  • Update frequency: every 0.1 days
  • Top authors: maidulcu (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /135 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.06MB] [CPU: ▼4.34ms] Passed 4 tests

A check of server-side resources used by Dynamic Pin It Button On Image Hover
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0745.83 ▲2.38
Dashboard /wp-admin3.38 ▲0.0351.79 ▼17.88
Posts /wp-admin/edit.php3.50 ▲0.1455.74 ▲5.99
Add New Post /wp-admin/post-new.php5.97 ▲0.0788.61 ▼6.99
Media Library /wp-admin/upload.php3.31 ▲0.0742.52 ▲5.14
Pin It Button /wp-admin/options-general.php?page=pin-it-button3.2734.55

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 13 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
dwl_pin_it_button_settings
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Dynamic Pin It Button On Image Hover
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲4714.68 ▲0.411.94 ▲0.1345.09 ▲0.64
Dashboard /wp-admin2,196 ▲195.52 ▼0.1489.57 ▼14.6940.13 ▼3.31
Posts /wp-admin/edit.php2,104 ▲41.99 ▼0.0236.80 ▲0.8633.80 ▼0.45
Add New Post /wp-admin/post-new.php1,534 ▼023.14 ▲0.26655.81 ▼28.0153.17 ▼0.64
Media Library /wp-admin/upload.php1,407 ▲74.19 ▲0.0195.65 ▼27.9942.94 ▼6.89
Pin It Button /wp-admin/options-general.php?page=pin-it-button8812.0523.5728.12

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
  • This plugin does not fully uninstall, leaving 7 options in the database
    • dwl_pin_it_button_settings
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • 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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/dynamic-pin-it-button-on-image-hover/includes/class-dynamic-pinterest-settings.php:186

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
4 plugin tags: pin it button, pin images, pin photo, pinterest

dynamic-pin-it-button-on-image-hover/dynamic-pinterest-pin-it-button-on-image-hover.php 85% from 13 tests

Analyzing the main PHP file in "Dynamic Pin It Button On Image Hover" version 1.0.0
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 ("dynamic-pin-it-button-on-image-hover.php" instead of "dynamic-pinterest-pin-it-button-on-image-hover.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity5.83
▷ Minimum class complexity1.00
▷ Maximum class complexity15.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods29
▷ Static methods26.90%
▷ Public methods2689.66%
▷ Protected methods00.00%
▷ Private methods310.34%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
There were not PNG files found in your plugin