10% office-visits-logbook

Code Review | Office Visits Logbook Plugin for WordPress

WordPress plugin Office Visits Logbook Plugin for WordPress scored10%from 54 tests.

About plugin

  • Plugin page: office-visits-log...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.1.1
  • WordPress version: 6.3.1
  • First release: Nov 2, 2022
  • Latest release: Aug 10, 2023
  • Number of updates: 100
  • Update frequency: every 2.8 days
  • Top authors: v20202020 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,294 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)

Server metrics [RAM: ▼0.24MB] [CPU: ▼29.97ms] Passed 4 tests

This is a short check of server-side resources used by Office Visits Logbook Plugin for WordPress
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.12 ▲0.6643.65 ▲2.32
Dashboard /wp-admin3.71 ▲0.4029.04 ▼23.29
Posts /wp-admin/edit.php3.71 ▲0.3528.72 ▼19.39
Add New Post /wp-admin/post-new.php3.71 ▼2.1827.79 ▼68.63
Media Library /wp-admin/upload.php3.71 ▲0.4727.43 ▼8.55

Server storage [IO: ▲13.51MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 81 new files
Database: 8 new tables, 6 new options
New tables
wp_dragonvisitzyx987_type
wp_dragonvisitzyx987_log
wp_dragonvisitzyx987_constant
wp_dragonvisitzyx987_users
wp_dragonvisitzyx987_role
wp_dragonvisitzyx987_typecategory
wp_dragonvisitzyx987_department
wp_dragonvisitzyx987_visit
New WordPress options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
can_compress_scripts
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Office Visits Logbook Plugin for WordPress
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.57 ▼0.621.76 ▼0.2744.19 ▼4.21
Dashboard /wp-admin2,207 ▲284.83 ▼1.05114.70 ▲9.4638.55 ▼4.83
Posts /wp-admin/edit.php2,096 ▲42.00 ▲0.0038.52 ▼1.5134.33 ▼0.77
Add New Post /wp-admin/post-new.php1,540 ▲2022.78 ▼0.38611.91 ▼23.0667.05 ▲0.67
Media Library /wp-admin/upload.php1,392 ▲74.30 ▲0.11107.38 ▼11.1444.51 ▼8.20
Office Visits Logbook /wp-admin/options-general.php?page=Office Visits Logbook4,8683.8597.83145.46

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin cannot be uninstalled
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • The uninstall procedure failed, leaving 8 tables in the database
    • wp_dragonvisitzyx987_typecategory
    • wp_dragonvisitzyx987_log
    • wp_dragonvisitzyx987_type
    • wp_dragonvisitzyx987_visit
    • wp_dragonvisitzyx987_role
    • wp_dragonvisitzyx987_department
    • wp_dragonvisitzyx987_constant
    • wp_dragonvisitzyx987_users
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/office-visits-logbook/dragonvisitzyx987_masterpage2.php
  • 10× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/office-visits-logbook/dragonvisitzyx987_admin.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function dragonvisitzyx987_getAllSettings() in wp-content/plugins/office-visits-logbook/dragonvisitzyx987_masterpage.php:7
    • > PHP Fatal error
      Uncaught Error: Call to a member function query() on null in wp-content/plugins/office-visits-logbook/dragonvisitzyx987_storedprocedures.php:4
    • > PHP Notice
      Trying to get property 'use_mysqli' of non-object in wp-content/plugins/office-visits-logbook/dragonvisitzyx987_admin.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_current_user() in wp-content/plugins/office-visits-logbook/dragonvisitzyx987_landingpage.php:3
    • > PHP Notice
      Trying to get property 'use_mysqli' of non-object in wp-content/plugins/office-visits-logbook/dragonvisitzyx987_admin.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function dragonvisitzyx987_showLandingPage() in wp-content/plugins/office-visits-logbook/template-officevisitslogbook.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/office-visits-logbook/dragonvisitzyx987_createvisit.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/office-visits-logbook/dragonvisitzyx987_editvisit.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/office-visits-logbook/dragonvisitzyx987_importer.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 81% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Requires php: Version not formatted correctly
  • Tags: Too many tags (14 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: Please add descriptions for these screenshots #1, #10, #11, #12, #13, #2, #3, #4, #5, #6, #7, #8, #9 in office-visits-logbook/assets to your readme.txt
Please take inspiration from this readme.txt

office-visits-logbook/dragonvisitzyx987_importer.php 85% from 13 tests

This is the main PHP file of "Office Visits Logbook Plugin for WordPress" version 1.0.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 609 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("office-visits-logbook.php" instead of "dragonvisitzyx987_importer.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin69,927 lines of code in 43 files:
LanguageFilesBlank linesComment linesLines of code
CSS208,23321437,964
PHP91,39623414,145
JavaScript123,5501,65112,445
SQL15361715,369
JSON1004

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions101
▷ Named functions9594.06%
▷ Anonymous functions65.94%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
8 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/no_img2.png7.66KB3.09KB▼ 59.67%
css/images/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%
css/images/ui-icons_777777_256x240.png6.84KB4.18KB▼ 38.84%
css/images/ui-icons_444444_256x240.png6.84KB4.18KB▼ 38.90%
(invalid) css/scroll_forward.png0.10KB0.00KB▼ 100.00%