78% disqus-popular-posts

Code Review | Disqus Popular Posts

WordPress plugin Disqus Popular Posts scored78%from 54 tests.

About plugin

  • Plugin page: disqus-popular-posts
  • Plugin version: 2.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.2
  • WordPress version: 6.3.1
  • First release: Dec 24, 2014
  • Latest release: Feb 5, 2018
  • Number of updates: 98
  • Update frequency: every 11.6 days
  • Top authors: godthor (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

60+ active /9,061 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.13MB] [CPU: ▼11.41ms] Passed 4 tests

A check of server-side resources used by Disqus Popular Posts
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1537.58 ▼3.94
Dashboard /wp-admin3.45 ▲0.1048.20 ▼19.46
Posts /wp-admin/edit.php3.50 ▲0.1454.16 ▼5.51
Add New Post /wp-admin/post-new.php6.03 ▲0.1494.45 ▼16.72
Media Library /wp-admin/upload.php3.37 ▲0.1439.22 ▲2.02
Disqus Popular Posts /wp-admin/options-general.php?page=disqus-popular-posts3.4037.74

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
widget_dpp_widget
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Disqus Popular Posts
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲714.34 ▼0.021.83 ▼0.2140.41 ▲0.36
Dashboard /wp-admin2,199 ▲225.60 ▼0.0484.87 ▼8.4440.37 ▼3.53
Posts /wp-admin/edit.php2,104 ▲12.01 ▼0.0339.27 ▲0.8135.62 ▲0.22
Add New Post /wp-admin/post-new.php1,529 ▲323.50 ▲0.57674.26 ▼0.1556.80 ▲8.61
Media Library /wp-admin/upload.php1,395 ▼24.16 ▲0.0398.37 ▲0.2542.35 ▲1.40
Disqus Popular Posts /wp-admin/options-general.php?page=disqus-popular-posts1,4062.1622.6231.05

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_dpp_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=disqus-popular-posts
    • > Notice in wp-content/plugins/disqus-popular-posts/dpp_admin.php+242
    Undefined index: mode
  • 13 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=disqus-popular-posts
    • > Notice in wp-content/plugins/disqus-popular-posts/dpp_admin.php+205
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/options-general.php?page=disqus-popular-posts
    • > Notice in wp-content/plugins/disqus-popular-posts/dpp_admin.php+61
    Undefined variable: disqus_data
    • > GET request to /wp-admin/options-general.php?page=disqus-popular-posts
    • > Notice in wp-content/plugins/disqus-popular-posts/dpp_admin.php+67
    Undefined variable: PHP_SELF
    • > GET request to /wp-admin/options-general.php?page=disqus-popular-posts
    • > Notice in wp-content/plugins/disqus-popular-posts/dpp_admin.php+117
    Undefined variable: comments_text_first

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
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Notice
      Undefined index: mode in wp-content/plugins/disqus-popular-posts/dpp_admin.php on line 242
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/disqus-popular-posts/dpp_admin.php:274
    • > PHP Notice
      Undefined index: mode in wp-content/plugins/disqus-popular-posts/dpp_admin.php on line 242
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/disqus-popular-posts/dpp.php:445

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: widget, disqus, shortcode, posts, comments

disqus-popular-posts/dpp.php 92% from 13 tests

The main file in "Disqus Popular Posts" v. 2.1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("disqus-popular-posts.php" instead of "dpp.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected829 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP214092808
JavaScript12021

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.65
Average class complexity79.00
▷ Minimum class complexity54.00
▷ Maximum class complexity104.00
Average method complexity13.00
▷ Minimum method complexity1.00
▷ Maximum method complexity80.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods13
▷ Static methods215.38%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
There are no PNG files in this plugin