78% pin-it-button

Code Review | Pinterest Pin It Button For Images

WordPress plugin Pinterest Pin It Button For Images scored78%from 54 tests.

About plugin

  • Plugin page: pin-it-button
  • Plugin version: 0.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2.1-3.4.1
  • WordPress version: 6.3.1
  • First release: Aug 1, 2012
  • Latest release: Aug 17, 2012
  • Number of updates: 13
  • Update frequency: every 1.3 days
  • Top authors: iamdangavin (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

90+ active /15,216 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▼0.17MB] [CPU: ▼20.83ms] Passed 4 tests

Server-side resources used by Pinterest Pin It Button For Images
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.42 ▼0.0426.10 ▼15.42
Dashboard /wp-admin3.15 ▼0.1534.57 ▼16.41
Posts /wp-admin/edit.php3.29 ▼0.0735.21 ▼18.70
Add New Post /wp-admin/post-new.php5.48 ▼0.4171.33 ▼32.80
Media Library /wp-admin/upload.php3.22 ▼0.0129.92 ▼12.64
Pin it! /wp-admin/options-general.php?page=pib-settings3.1326.07

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 8 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
pib_button_options
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Pinterest Pin It Button For Images
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲7414.25 ▼0.301.84 ▲0.2242.14 ▼0.42
Dashboard /wp-admin2,205 ▲285.63 ▲0.1089.86 ▼7.3339.45 ▼11.57
Posts /wp-admin/edit.php2,107 ▲72.00 ▲0.0539.76 ▼1.8536.96 ▼1.79
Add New Post /wp-admin/post-new.php1,534 ▲623.03 ▼0.21639.35 ▼55.0657.78 ▲1.08
Media Library /wp-admin/upload.php1,407 ▲74.19 ▲0.0195.71 ▼13.9845.47 ▼1.07
Pin it! /wp-admin/options-general.php?page=pib-settings9361.9438.1843.42

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • can_compress_scripts
    • pib_button_options
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=pib-settings
    • > User deprecated in wp-includes/functions.php+5453
    Function get_current_theme is deprecated since version 3.4.0! Use wp_get_theme() instead.

SRP 50% 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
Almost there! Just fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/pin-it-button/pib-admin.php:13
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/pin-it-button/pib-admin.php on line 13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (If your image has padding, borders, or any additional placement styles. The Pin It! Default styles will need to be overwritten.), #2 (Pin It! Settings page showing the media upload box.)
The official readme.txt is a good inspiration

pin-it-button/pib-admin.php 92% from 13 tests

The main file in "Pinterest Pin It Button For Images" v. 0.3.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
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 ("pin-it-button.php" instead of "pib-admin.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
No dangerous file extensions were detected337 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP15236239
CSS11184
JavaScript171214

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
4 PNG files occupy 0.17MB with 0.10MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/pib-pinterest.png2.87KB1.59KB▼ 44.50%
images/pinterestlogo.png13.21KB5.23KB▼ 60.37%
screenshot-1.png84.18KB32.43KB▼ 61.48%
screenshot-2.png75.40KB27.86KB▼ 63.06%