62% pinit

Code Review | Pinit: Pinterest for WordPress

WordPress plugin Pinit: Pinterest for WordPress scored62%from 54 tests.

About plugin

  • Plugin page: pinit
  • Plugin version: 2.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.6
  • WordPress version: 6.3.1
  • First release: Oct 30, 2013
  • Latest release: Sep 2, 2016
  • Number of updates: 14
  • Update frequency: every 74.1 days
  • Top authors: deshack (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active /5,964 total downloads

Benchmarks

Plugin footprint 65% from 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: ▼1.86MB] [CPU: ▼54.93ms] Passed 4 tests

Analyzing server-side resources used by Pinit: Pinterest for WordPress
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.12 ▼1.345.01 ▼49.64
Dashboard /wp-admin2.16 ▼1.157.37 ▼44.48
Posts /wp-admin/edit.php2.16 ▼1.208.86 ▼39.54
Add New Post /wp-admin/post-new.php2.16 ▼3.737.01 ▼86.04
Media Library /wp-admin/upload.php2.16 ▼1.076.31 ▼24.95
Pinit /wp-admin/options-general.php?page=pinit2.166.72

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 343 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_pit_pinterest
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Pinit: Pinterest for WordPress
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲7514.70 ▲0.359.36 ▲7.2439.49 ▼5.71
Dashboard /wp-admin2,222 ▲344.85 ▼0.99108.88 ▼8.1140.41 ▼0.79
Posts /wp-admin/edit.php2,108 ▲161.98 ▼0.0840.02 ▲4.3734.52 ▲0.52
Add New Post /wp-admin/post-new.php1,556 ▲2118.31 ▼5.02610.67 ▼71.7549.91 ▼4.38
Media Library /wp-admin/upload.php1,401 ▲224.20 ▼0.10100.95 ▼1.7742.65 ▼1.12
Pinit /wp-admin/options-general.php?page=pinit1,2192.8265.4535.54

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/pinit/public/class-pinit.php+94
    Function create_function() is deprecated
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_pit_pinterest
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=pinit
    • > Deprecated in wp-content/plugins/pinit/public/class-pinit.php+94
    Function create_function() is deprecated

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 fix the following items
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/pinit/admin/includes/CMB2/bootstrap.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/pinit/includes/widgets/widgets.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pinit/includes/load_textdomain.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/pinit/admin/views/admin.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pinit/admin/includes/CMB2/init.php:119

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)
Please fix the following user-side errors
    • > GET request to /wp-admin/options-general.php?page=pinit
    • > Network (severe)
    http://i0.wp.com/codeat.co/wp-content/uploads/2016/03/social-twitter-light.png?w=52 - Failed to load resource: the server responded with a status of 404 (File Not Found)
    • > GET request to /wp-admin/options-general.php?page=pinit
    • > Network (severe)
    http://i0.wp.com/codeat.co/glossary/wp-content/uploads/sites/3/2016/02/cropped-Glossary_logo-ori-Lite-1.png?w=236 - Failed to load resource: the server responded with a status of 404 (File Not Found)
    • > GET request to /wp-admin/options-general.php?page=pinit
    • > Network (severe)
    http://i2.wp.com/codeat.co/wp-content/uploads/2016/02/cropped-logo-light.png?w=236 - Failed to load resource: the server responded with a status of 404 (File Not Found)
    • > GET request to /wp-admin/options-general.php?page=pinit
    • > Network (severe)
    http://i1.wp.com/codeat.co/wp-content/uploads/2016/03/social-linkedin-light.png?w=52 - Failed to load resource: the server responded with a status of 404 (File Not Found)
    • > GET request to /wp-admin/options-general.php?page=pinit
    • > Network (severe)
    http://i1.wp.com/codeat.co/pinit/wp-content/uploads/sites/2/2016/02/cropped-PinterestForWP_logo-ori-Lite-1.png?w=236 - Failed to load resource: the server responded with a status of 404 (File Not Found)
    • > GET request to /wp-admin/options-general.php?page=pinit
    • > Network (severe)
    http://i2.wp.com/codeat.co/wp-content/uploads/2016/03/social-facebook-light.png?w=52 - Failed to load resource: the server responded with a status of 404 (File Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Tags: You are using too many tags: 17 tag instead of maximum 10
  • Screenshots: Screenshot #6 (Pin It Button on site images) image not found
You can look at the official readme.txt

pinit/pinit.php Passed 13 tests

Analyzing the main PHP file in "Pinit: Pinterest for WordPress" version 2.1.1
115 characters long description:
Handy plugin that adds Pinterest Follow Button, Pin Widget, Profile Widget and Board Widget to your WordPress site.

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
Success! There were no dangerous files found in this plugin38,746 lines of code in 168 files:
LanguageFilesBlank linesComment linesLines of code
PO File12512,95816,57229,742
CSS51,0101,0234,008
PHP219752,3293,095
Sass11168231,116
JavaScript5169118691
Markdown131094

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity37.50
▷ Minimum class complexity3.00
▷ Maximum class complexity121.00
Average method complexity3.69
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes00.00%
Methods217
▷ Static methods2210.14%
▷ Public methods20494.01%
▷ Protected methods83.69%
▷ Private methods52.30%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants350.00%
▷ Class constants350.00%
▷ Public constants3100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
24 PNG files occupy 2.24MB with 1.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-5.png535.42KB163.75KB▼ 69.42%
admin/includes/CMB2/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
assets/banner-1544x500.png132.16KB40.95KB▼ 69.02%
admin/includes/CMB2/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
admin/includes/CMB2/images/ui-icons_cd0a0a_256x240.png4.27KB4.11KB▼ 3.78%