10% wp-pinterest

Code Review | WP Pinterest

WordPress plugin WP Pinterest scored10%from 54 tests.

About plugin

  • Plugin page: wp-pinterest
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-3.4
  • WordPress version: 6.3.1
  • First release: Jul 2, 2012
  • Latest release: Jul 2, 2012
  • Number of updates: 9
  • Update frequency: every 0.1 days
  • Top authors: techably (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /18,334 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/wp-pinterest/wp-pinterest.php+42
    Methods with the same name as their class will not be constructors in a future version of PHP; wp_pinterest_pinboard has a deprecated constructor

Server metrics [RAM: ▼1.88MB] [CPU: ▼52.35ms] Passed 4 tests

Server-side resources used by WP Pinterest
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.11 ▼1.354.17 ▼37.57
Dashboard /wp-admin2.13 ▼1.1812.52 ▼38.68
Posts /wp-admin/edit.php2.13 ▼1.237.12 ▼35.46
Add New Post /wp-admin/post-new.php2.13 ▼3.766.04 ▼97.69
Media Library /wp-admin/upload.php2.13 ▼1.105.02 ▼32.34
WP Pinterest /wp-admin/options-general.php?page=wp_pinterest_options2.135.83

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 22 new files
Database: no new tables, 8 new options
New WordPress options
widget_wp_pinterest_pinboard
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
wp_pinterest_options
widget_theysaidso_widget
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Pinterest
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲7513.32 ▼1.061.66 ▼0.3137.30 ▼7.03
Dashboard /wp-admin2,212 ▲295.86 ▲0.99108.79 ▼4.0539.69 ▼0.62
Posts /wp-admin/edit.php2,095 ▲62.04 ▲0.0141.76 ▲1.1034.69 ▼1.34
Add New Post /wp-admin/post-new.php1,533 ▲1923.13 ▲5.54570.21 ▼75.7849.28 ▼16.20
Media Library /wp-admin/upload.php1,394 ▲64.28 ▲0.1694.70 ▼19.9140.84 ▼5.23
WP Pinterest /wp-admin/options-general.php?page=wp_pinterest_options1,3186.50151.2684.99

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/wp-pinterest/wp-pinterest.php+42
    Methods with the same name as their class will not be constructors in a future version of PHP; wp_pinterest_pinboard has a deprecated constructor
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_wp_pinterest_pinboard
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=wp_pinterest_options
    • > Deprecated in wp-content/plugins/wp-pinterest/wp-pinterest.php+42
    Methods with the same name as their class will not be constructors in a future version of PHP; wp_pinterest_pinboard has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=wp_pinterest_options
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the wp_pinterest_styles handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=wp_pinterest_options
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the wp_pinterest_styles handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=wp_pinterest_options
    • > User notice in wp-includes/functions.php+5905
    Function wp_script_is was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the pinit handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=wp_pinterest_options
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in wp_pinterest_pinboard is deprecated since version 4.3.0! Use __construct() instead.
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp_pinterest_options
    • > Warning in wp-content/plugins/wp-pinterest/includes/admin-options.php+251
    Illegal string offset 'wp_pinterest_pin_it_button_layout'
  • 31 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp_pinterest_options
    • > Notice in wp-content/plugins/wp-pinterest/includes/admin-options.php+386
    Uninitialized string offset: 0
    • > GET request to /wp-admin/options-general.php?page=wp_pinterest_options
    • > Warning in wp-content/plugins/wp-pinterest/includes/admin-options.php+239
    Illegal string offset 'wp_pinterest_default_pin_img'
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp_pinterest_options
    • > Warning in wp-content/plugins/wp-pinterest/includes/admin-options.php+263
    Illegal string offset 'wp_pinterest_pin_it_button_single_display'
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp_pinterest_options
    • > Warning in wp-content/plugins/wp-pinterest/includes/admin-options.php+275
    Illegal string offset 'wp_pinterest_pin_it_button_page_display'
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp_pinterest_options
    • > Warning in wp-content/plugins/wp-pinterest/includes/admin-options.php+287
    Illegal string offset 'wp_pinterest_pin_it_button_excerpt_display'
    • > GET request to /wp-admin/options-general.php?page=wp_pinterest_options
    • > Warning in wp-content/plugins/wp-pinterest/includes/admin-options.php+329
    Illegal string offset 'wp_pinterest_username'
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp_pinterest_options
    • > Warning in wp-content/plugins/wp-pinterest/includes/admin-options.php+349
    Illegal string offset 'wp_pinterest_follow_button_layout'
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp_pinterest_options
    • > Warning in wp-content/plugins/wp-pinterest/includes/admin-options.php+362
    Illegal string offset 'wp_pinterest_follow_button_single_display'
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp_pinterest_options
    • > Warning in wp-content/plugins/wp-pinterest/includes/admin-options.php+374
    Illegal string offset 'wp_pinterest_follow_button_page_display'
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp_pinterest_options
    • > Warning in wp-content/plugins/wp-pinterest/includes/admin-options.php+386
    Illegal string offset 'wp_pinterest_follow_button_excerpt_display'

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-pinterest/includes/functions.php:53
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-pinterest/includes/admin-options.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wp-pinterest/includes/scripts.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-pinterest/includes/admin-options.php:24

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
    • > GET request to /wp-admin/options-general.php?page=wp_pinterest_options
    • > Other (severe) in unknown
    chrome-error://chromewebdata/ - Refused to display 'https://developers.google.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Options page), #2 (Pinboard Widget), #3 (Pin-it and Follow buttons)
The official readme.txt is a good inspiration

wp-pinterest/wp-pinterest.php 92% from 13 tests

"WP Pinterest" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 170 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin697 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP514776688
CSS1009

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity12.00
▷ Minimum class complexity12.00
▷ Maximum class complexity12.00
Average method complexity3.75
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions28
▷ Named functions28100.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
11 PNG files occupy 0.09MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/images/big-p-button.png16.84KB2.22KB▼ 86.82%
includes/images/small-p-button.png3.74KB0.84KB▼ 77.41%
includes/images/pinterest-vertical.png1.32KB1.05KB▼ 20.58%
includes/images/big-p-button-red.png7.93KB1.75KB▼ 77.94%
includes/images/follow-on-pinterest-button.png9.59KB2.25KB▼ 76.59%