72% social-comments

Code Review | Social Comments

WordPress plugin Social Comments scored72%from 54 tests.

About plugin

  • Plugin page: social-comments
  • Plugin version: 0.1.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.7.0
  • WordPress version: 6.3.1
  • First release: May 15, 2013
  • Latest release: Dec 18, 2016
  • Number of updates: 16
  • Update frequency: every 82.3 days
  • Top authors: bainternet (100%)

Code review

54 tests

User reviews

39 reviews

Install metrics

900+ active /72,366 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.18MB] [CPU: ▲0.31ms] Passed 4 tests

A check of server-side resources used by Social Comments
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.78 ▲0.0547.27 ▲4.62
Dashboard /wp-admin3.86 ▲0.2956.99 ▲4.24
Posts /wp-admin/edit.php3.91 ▲0.2353.93 ▼8.14
Add New Post /wp-admin/post-new.php6.38 ▲0.23108.11 ▲0.51
Media Library /wp-admin/upload.php3.72 ▲0.2342.83 ▲5.72
All Comments /wp-admin/edit-comments.php3.7847.45
Social Comments /wp-admin/edit-comments.php?page=socialCommentspanel3.7238.38

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 72 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Social Comments
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲6014.29 ▲0.051.90 ▲0.2543.82 ▼4.83
Dashboard /wp-admin2,212 ▲355.57 ▼0.1286.45 ▼2.8240.61 ▼0.59
Posts /wp-admin/edit.php2,117 ▲202.06 ▲0.0437.38 ▼3.3834.30 ▼7.13
Add New Post /wp-admin/post-new.php1,560 ▲623.24 ▲4.81594.66 ▼30.5464.68 ▲9.81
Media Library /wp-admin/upload.php1,417 ▲174.24 ▼0.00101.68 ▼8.7543.18 ▼4.35
All Comments /wp-admin/edit-comments.php1,8212.2939.8835.87
Social Comments /wp-admin/edit-comments.php?page=socialCommentspanel2,1963.8269.24179.18

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

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)
Please fix the following server-side errors
    • > GET request to /wp-admin/edit-comments.php?page=socialCommentspanel
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/edit-comments.php?page=socialCommentspanel
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit-comments.php?page=socialCommentspanel
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_permalink() in wp-content/plugins/social-comments/views/Google.comments.markup.php:11
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/social-comments/views/Facebook.comments.markup.php:4
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/social-comments/views/disqus.comments.markup.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/social-comments/plugin.php:71
    • > PHP Fatal error
      Uncaught Error: Class 'SimplePanel' not found in wp-content/plugins/social-comments/classes/gpcomments_Panel_Class.php:14

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/edit-comments.php?page=socialCommentspanel
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).live is not a function" "TypeError: $(...).live is not a function\n at Object.hooks (/wp-admin/edit-comments.php?page=socialCommentspanel:223:61)\n at HTMLDocument.\u003Canonymous> (/wp-admin/edit-comments.php?page=socialCommentspanel:373:22)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/edit-comments.php?page=socialCommentspanel
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: $(...).live is not a function

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
9 plugin tags: disqus comments, 1 comments, comments, tabbed comments social comments, facebook comments...

social-comments/plugin.php 92% from 13 tests

The primary PHP file in "Social Comments" version 0.1.6 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("social-comments.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin1,614 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP91498201,376
CSS300238

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity35.00
▷ Minimum class complexity15.00
▷ Maximum class complexity53.00
Average method complexity2.92
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods71
▷ Static methods00.00%
▷ Public methods71100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
57 PNG files occupy 0.29MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icons/retrobadge/facebook.png4.42KB2.60KB▼ 41.14%
assets/images/icons/somicro/gplus.png3.62KB0.81KB▼ 77.56%
assets/images/icons/denimdark/facebook.png5.63KB2.22KB▼ 60.49%
assets/images/icons/apricum/gplus.png12.32KB4.93KB▼ 59.99%
assets/images/icons/creamysilver/disqus.png2.50KB2.05KB▼ 18.17%