78% mpoperationlogs

Code Review | mpOperationLogs

WordPress plugin mpOperationLogs scored78%from 54 tests.

About plugin

  • Plugin page: mpoperationlogs
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-4.7
  • WordPress version: 6.3.1
  • First release: Dec 29, 2016
  • Latest release: Mar 3, 2017
  • Number of updates: 6
  • Update frequency: every 9.3 days
  • Top authors: burningx (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /974 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.08MB] [CPU: ▼9.63ms] Passed 4 tests

This is a short check of server-side resources used by mpOperationLogs
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0937.16 ▼3.10
Dashboard /wp-admin3.40 ▲0.0549.54 ▼21.32
Posts /wp-admin/edit.php3.51 ▲0.1550.83 ▲5.78
Add New Post /wp-admin/post-new.php5.98 ▲0.0991.97 ▼14.99
Media Library /wp-admin/upload.php3.32 ▲0.0936.17 ▲0.90
IP列表 /wp-admin/admin.php?page=iplist3.2830.51
管理员操作日志 /wp-admin/admin.php?page=mpoplogs_menuIndex3.2831.44
日志列表 /wp-admin/admin.php?page=operationLog3.2827.56

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 15 new files
Database: 2 new tables, 7 new options
New tables
wp_mp_logs
wp_mp_ips
New WordPress options
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
mp_operation_db_version
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for mpOperationLogs
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲8513.66 ▼0.591.68 ▼0.1441.39 ▲1.63
Dashboard /wp-admin2,237 ▲494.92 ▲0.02108.50 ▼8.2547.61 ▲0.98
Posts /wp-admin/edit.php2,120 ▲311.98 ▼0.0340.13 ▲5.0843.93 ▲8.59
Add New Post /wp-admin/post-new.php1,567 ▲3118.22 ▼5.19606.14 ▼61.6069.38 ▲7.62
Media Library /wp-admin/upload.php1,422 ▲344.23 ▲0.07100.44 ▲3.2950.08 ▲9.47
IP列表 /wp-admin/admin.php?page=iplist8141.4314.9457.13
管理员操作日志 /wp-admin/admin.php?page=mpoplogs_menuIndex7962.0224.8644.52
日志列表 /wp-admin/admin.php?page=operationLog7791.4312.4048.46

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
The following issues need your attention
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/mpoperationlogs/template/logsList.php
    • > /wp-content/plugins/mpoperationlogs/template/ipsList.php
  • 11× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/mpoperationlogs/template/loglist_td.php on line 1
    • > PHP Fatal error
      require_once(): Failed opening required 'lib/OperationlogBase.php' (include_path='.:/usr/share/php') in wp-content/plugins/mpoperationlogs/lib/MpIpLogs.class.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'lib/OperationlogBase.php' (include_path='.:/usr/share/php') in wp-content/plugins/mpoperationlogs/lib/MpLogs.class.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mpoperationlogs/dispatcher.php:2
    • > PHP Notice
      Undefined variable: admin_ajax_url in wp-content/plugins/mpoperationlogs/template/logsList.php on line 45
    • > PHP Warning
      require_once(lib/OperationlogBase.php): failed to open stream: No such file or directory in wp-content/plugins/mpoperationlogs/lib/MpLogs.class.php on line 2
    • > PHP Notice
      Undefined variable: mrpengRoot in wp-content/plugins/mpoperationlogs/lib/MpLogs.class.php on line 2
    • > PHP Warning
      require_once(lib/OperationlogBase.php): failed to open stream: No such file or directory in wp-content/plugins/mpoperationlogs/lib/MpIpLogs.class.php on line 2
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/mpoperationlogs/template/ipslist_td.php on line 1
    • > PHP Notice
      Undefined variable: mrpengRoot in wp-content/plugins/mpoperationlogs/lib/MpIpLogs.class.php on line 2

User-side errors Passed 1 test

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

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
3 plugin tags: ip record, ip address, operation log

mpoperationlogs/mpOperationLogs.php 92% from 13 tests

The primary PHP file in "mpOperationLogs" version 1.0.1 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("mpoperationlogs.php" instead of "mpOperationLogs.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin818 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP1211339818

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity10.75
▷ Minimum class complexity4.00
▷ Maximum class complexity18.00
Average method complexity2.15
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes125.00%
▷ Concrete classes375.00%
▷ Final classes00.00%
Methods34
▷ Static methods12.94%
▷ Public methods2779.41%
▷ Protected methods00.00%
▷ Private methods720.59%
Functions20
▷ Named functions1890.00%
▷ Anonymous functions210.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