10% disqus-popular-threads-widget

Code Review | Disqus Popular Threads Widget

WordPress plugin Disqus Popular Threads Widget scored10%from 54 tests.

About plugin

  • Plugin page: disqus-popular-th...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-3.5.1
  • WordPress version: 6.3.1
  • First release: Mar 9, 2013
  • Latest release: May 24, 2013
  • Number of updates: 10
  • Update frequency: every 7.7 days
  • Top authors: rzvagelsky (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active /3,963 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/disqus-popular-threads-widget/wp-disqus-pt.php+181
    Function create_function() is deprecated

Server metrics [RAM: ▼1.90MB] [CPU: ▼55.57ms] Passed 4 tests

Analyzing server-side resources used by Disqus Popular Threads Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.375.11 ▼39.82
Dashboard /wp-admin2.11 ▼1.196.24 ▼44.83
Posts /wp-admin/edit.php2.11 ▼1.256.04 ▼44.17
Add New Post /wp-admin/post-new.php2.11 ▼3.786.06 ▼93.47
Media Library /wp-admin/upload.php2.11 ▼1.126.06 ▼32.33
Disqus Settings /wp-admin/options-general.php?page=diqus-threads-settings-page2.116.20

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 3 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_disqus_popular_threads_widget
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Disqus Popular Threads Widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,798 ▲3714.35 ▼0.001.84 ▼0.0443.91 ▼0.61
Dashboard /wp-admin2,196 ▲195.61 ▼0.0584.08 ▼20.9836.30 ▼9.67
Posts /wp-admin/edit.php2,101 ▲12.02 ▼0.0135.01 ▼0.1436.48 ▲0.89
Add New Post /wp-admin/post-new.php1,529 ▲323.58 ▲0.16675.80 ▲7.9256.32 ▼7.70
Media Library /wp-admin/upload.php1,404 ▲74.19 ▲0.02102.83 ▼4.4845.35 ▼1.99
Disqus Settings /wp-admin/options-general.php?page=diqus-threads-settings-page8151.9924.1829.39

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/disqus-popular-threads-widget/wp-disqus-pt.php+181
    Function create_function() is deprecated
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_disqus_popular_threads_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=diqus-threads-settings-page
    • > Deprecated in wp-content/plugins/disqus-popular-threads-widget/wp-disqus-pt.php+181
    Function create_function() is deprecated

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
The following issues need your attention
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/disqus-popular-threads-widget/wp-disqus-pt.php:31
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/disqus-popular-threads-widget/wp-disqus-pt.php on line 31

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 issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% 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
Attributes that require attention:
  • Donate link: Please fix this invalid url: ""
Please take inspiration from this readme.txt

disqus-popular-threads-widget/wp-disqus-pt.php 85% from 13 tests

"Disqus Popular Threads Widget" version 1.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("disqus-popular-threads-widget.php" instead of "wp-disqus-pt.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 149 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
Good job! No executable or dangerous file extensions detected255 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP12565151
JavaScript1312104

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity3.25
▷ Minimum method complexity1.00
▷ Maximum method complexity6.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%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin