84% unread-posts

Code Review | Unread Posts

WordPress plugin Unread Posts scored 84% from 54 tests.

About plugin

  • Plugin page: unread-posts
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-4.2
  • WordPress version: 5.9.2
  • First release: May 8, 2015
  • Latest release: Oct 14, 2015
  • Number of updates: 5
  • Update frequency: every 31.8 days
  • Top authors: danielpataki (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active / 1,606 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼283.59ms] Passed 4 tests

Analyzing server-side resources used by Unread Posts
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.17103.73 ▲22.64
Dashboard /wp-admin3.52 ▲0.1242.58 ▲4.09
Posts /wp-admin/edit.php3.75 ▲0.1142.03 ▼0.18
Add New Post /wp-admin/post-new.php6.98 ▲0.02141.39 ▼1,140.15
Media Library /wp-admin/upload.php3.40 ▲0.1131.19 ▲1.88
Unread Posts /wp-admin/options-general.php?page=unread-posts-settings3.3824.72

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 16 new files
Database: no new tables, 1 new option
New WordPress options
widget_up-unread-posts

Browser metrics Passed 4 tests

Unread Posts: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,786 ▲6415.63 ▲0.516.54 ▲0.793.43 ▲1.02
Dashboard /wp-admin2,879 ▲256.10 ▼0.07125.69 ▼11.22154.81 ▼3.55
Posts /wp-admin/edit.php2,693 ▲23.24 ▲0.0164.70 ▼1.28142.91 ▼2.74
Add New Post /wp-admin/post-new.php1,757 ▲9621.07 ▲4.79447.43 ▲49.39162.15 ▼12.60
Media Library /wp-admin/upload.php1,706 ▲85.53 ▲0.01137.69 ▼0.83190.73 ▼14.89
Unread Posts /wp-admin/options-general.php?page=unread-posts-settings1,3882.8063.52133.96

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin does not fully uninstall, leaving 1 option in the database
    • widget_up-unread-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
The following issues need your attention
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'UP_Unread_Posts_Handler' not found in wp-content/plugins/unread-posts/classes/class-up-unread-posts-handler-cookie.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/unread-posts/classes/class-up-unread-posts-widget.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'UP_Unread_Posts_Handler' not found in wp-content/plugins/unread-posts/classes/class-up-unread-posts-handler-db.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/unread-posts/classes/class-up-unread-posts-widget.php:26

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

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
3 plugin tags: related, widget, posts

unread-posts/unead-posts.php 92% from 13 tests

The main file in "Unread Posts" v. 1.0.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("unread-posts.php" instead of "unead-posts.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected585 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP7170534421
CSS2271788
PO File1202453
JavaScript28423

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity8.83
▷ Minimum class complexity1.00
▷ Maximum class complexity27.00
Average method complexity2.57
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods35
▷ Static methods38.57%
▷ Public methods3291.43%
▷ Protected methods38.57%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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