83% pinterest-widget

Code Review | Pinterest Widget

WordPress plugin Pinterest Widget scored 83% from 54 tests.

About plugin

  • Plugin page: pinterest-widget
  • Plugin version: 3.5.0
  • PHP version: 7.4.16
  • WordPress version: 5.8.1
  • First release: Jul 22, 2013
  • Latest release: May 22, 2021
  • Number of updates: 67
  • Update frequency: every 42.7 days
  • Top authors: ujw0l (100%)

Code review

54 tests

User reviews

1 review

Install metrics

500+ active / 8,909 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.03MB] [CPU: ▼143.82ms] Passed 4 tests

A check of server-side resources used by Pinterest Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.87 ▲0.0331.77 ▲0.33
Dashboard /wp-admin3.09 ▲0.0440.94 ▼2.78
Posts /wp-admin/edit.php3.14 ▲0.0338.03 ▼6.60
Add New Post /wp-admin/post-new.php5.45 ▲0.0190.53 ▼566.23
Media Library /wp-admin/upload.php3.03 ▲0.0334.37 ▲1.38

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 1 new option
New WordPress options
widget_pinterest_widget

Browser metrics Passed 4 tests

Checking browser requirements for Pinterest Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲8315.86 ▲0.397.29 ▼3.3149.39 ▼2.14
Dashboard /wp-admin2,973 ▲425.84 ▼0.09139.51 ▼2.24121.85 ▲1.55
Posts /wp-admin/edit.php2,739 ▼02.68 ▼0.0262.21 ▼3.7286.55 ▼8.10
Add New Post /wp-admin/post-new.php1,876 ▲419.40 ▲0.07388.51 ▲1.61105.88 ▼3.38
Media Library /wp-admin/upload.php1,807 ▼05.01 ▲0.01144.85 ▼5.88126.64 ▲8.59

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • widget_pinterest_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/pinterest-widget/pinterest_widget.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% 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
These attributes need your attention:
  • Requires at least: Version format is invalid
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Screenshot of the front end), #2 (Screen shot of Backend)
You can take inspiration from this readme.txt

pinterest-widget/pinterest_widget.php 92% from 13 tests

The main PHP script in "Pinterest Widget" version 3.5.0 is automatically included on every request by WordPress
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 ("pinterest-widget.php" instead of "pinterest_widget.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin311 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript22819139
PHP13536114
CSS116031
JSON10027

PHP code Passed 2 tests

Analyzing 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.18
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity2.43
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 1.38MB with 0.88MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png25.66KB12.72KB▼ 50.42%
screenshot-1.png1,388.17KB314.09KB▼ 77.37%