74% jc-pinterest-pin

Code Review | JC pinterest pin

WordPress plugin JC pinterest pin scored74%from 54 tests.

About plugin

  • Plugin page: jc-pinterest-pin
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.9.1
  • WordPress version: 6.3.1
  • First release: Jun 8, 2014
  • Latest release: Jun 8, 2014
  • Number of updates: 4
  • Update frequency: every 0.5 days
  • Top authors: rajiv-jyasha (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /673 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.04MB] [CPU: ▼0.24ms] Passed 4 tests

Server-side resources used by JC pinterest pin
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0352.04 ▲12.14
Dashboard /wp-admin3.34 ▲0.0450.83 ▼2.16
Posts /wp-admin/edit.php3.45 ▲0.1047.96 ▼4.57
Add New Post /wp-admin/post-new.php5.92 ▲0.0497.21 ▲3.32
Media Library /wp-admin/upload.php3.26 ▲0.0437.19 ▲2.45

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

JC pinterest pin: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,837 ▲5114.18 ▼0.0916.07 ▲14.3241.57 ▲0.18
Dashboard /wp-admin2,211 ▲345.65 ▲0.0798.79 ▲2.9744.96 ▼1.68
Posts /wp-admin/edit.php2,119 ▲191.99 ▲0.0435.17 ▼1.1234.44 ▼7.35
Add New Post /wp-admin/post-new.php1,544 ▲1523.10 ▼0.06646.56 ▼53.0052.96 ▼0.77
Media Library /wp-admin/upload.php1,419 ▲194.19 ▲0.0495.72 ▼11.7840.84 ▼3.61

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method PinterestPin::uninstall() should not be called statically
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 16× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: result in wp-content/plugins/jc-pinterest-pin/views/admin_addpin.php on line 21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/jc-pinterest-pin/views/admin_addpin.php:66
    • > PHP Notice
      Undefined variable: result in wp-content/plugins/jc-pinterest-pin/views/admin_addpin.php on line 12
    • > PHP Notice
      Undefined variable: result in wp-content/plugins/jc-pinterest-pin/views/admin_addpin.php on line 22
    • > PHP Notice
      Undefined variable: result in wp-content/plugins/jc-pinterest-pin/views/admin_addpin.php on line 32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/jc-pinterest-pin/pinterestpin.php:167
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/jc-pinterest-pin/views/admin_addpin.php on line 22
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/jc-pinterest-pin/views/admin_addpin.php on line 33
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/jc-pinterest-pin/views/admin_addpin.php on line 13
    • > PHP Notice
      Undefined variable: result in wp-content/plugins/jc-pinterest-pin/views/admin_addpin.php on line 13

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: pinterest-pin, pinterest, addon, socialmedia

jc-pinterest-pin/pinterestpin.php 92% from 13 tests

The main PHP file in "JC pinterest pin" ver. 1.0.1 adds more information about the plugin and also serves as the entry point for this 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 ("jc-pinterest-pin.php" instead of "pinterestpin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected250 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP55767250

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.25
Average class complexity5.75
▷ Minimum class complexity2.00
▷ Maximum class complexity11.00
Average method complexity1.95
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods20
▷ Static methods315.00%
▷ Public methods1470.00%
▷ Protected methods00.00%
▷ Private methods630.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants00.00%
▷ Class constants5100.00%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected