74% observer

Code Review | Observer

WordPress plugin Observer scored 74% from 54 tests.

About plugin

  • Plugin page: observer
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.5
  • WordPress version: 6.3.1
  • First release: Sep 9, 2013
  • Latest release: Apr 2, 2016
  • Number of updates: 12
  • Update frequency: every 78.0 days
  • Top authors: anukit (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 991 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.10MB] [CPU: ▼3.64ms] Passed 4 tests

Analyzing server-side resources used by Observer
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1139.17 ▼1.09
Dashboard /wp-admin3.40 ▲0.1044.02 ▼4.28
Posts /wp-admin/edit.php3.51 ▲0.1650.36 ▲1.14
Add New Post /wp-admin/post-new.php5.98 ▲0.1086.26 ▼5.19
Media Library /wp-admin/upload.php3.32 ▲0.1033.30 ▼4.01

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Observer: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.63 ▼0.954.69 ▲2.8938.55 ▼15.78
Dashboard /wp-admin2,206 ▲215.92 ▲1.01104.16 ▲4.1739.09 ▼4.66
Posts /wp-admin/edit.php2,089 ▼02.00 ▲0.0140.63 ▼4.9442.47 ▲8.56
Add New Post /wp-admin/post-new.php1,514 ▼1417.75 ▼5.53588.16 ▼89.4249.12 ▼3.03
Media Library /wp-admin/upload.php1,385 ▼34.21 ▼0.0396.23 ▼19.8142.56 ▼4.49

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > User deprecated in wp-includes/functions.php+5737
    Function WP_User->id was called with an argument that is deprecated since version 2.1.0! Use WP_User->ID instead.
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/observer/observer.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 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
5 plugin tags: network, logging, audit, multisite, admin

observer/observer.php Passed 13 tests

The principal PHP file in "Observer" v. 1.0.4 is loaded by WordPress automatically on each request
136 characters long description:
Creates an audit trail log file for multisite super admin actions. Used only for multisite installations, and must be Network Activated.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin283 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP278222283

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity44.00
▷ Minimum class complexity44.00
▷ Maximum class complexity44.00
Average method complexity2.23
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods35
▷ Static methods00.00%
▷ Public methods2777.14%
▷ Protected methods720.00%
▷ Private methods12.86%
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
No PNG images were found in this plugin