72% autooffice

Code Review | Autooffice Plugin

WordPress plugin Autooffice Plugin scored72%from 54 tests.

About plugin

  • Plugin page: autooffice
  • Plugin version: 1.0.04
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.9-7.3.10
  • WordPress version: 6.3.1
  • First release: Jan 25, 2019
  • Latest release: Oct 24, 2019
  • Number of updates: 10
  • Update frequency: every 27.4 days
  • Top authors: autooffice (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /586 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.07MB] [CPU: ▼4.18ms] Passed 4 tests

Analyzing server-side resources used by Autooffice Plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0542.60 ▼2.32
Dashboard /wp-admin3.39 ▲0.0953.68 ▼0.17
Posts /wp-admin/edit.php3.50 ▲0.1549.58 ▼6.61
Add New Post /wp-admin/post-new.php5.97 ▲0.0890.16 ▼7.62
Media Library /wp-admin/upload.php3.31 ▲0.0840.28 ▲4.15
Code Html /wp-admin/admin.php?page=autooffice-html-code3.4039.80
Code Js /wp-admin/admin.php?page=autooffice-js-code3.4037.52
Code Css /wp-admin/admin.php?page=autooffice-css-code3.4036.59
Settings /wp-admin/admin.php?page=autooffice3.4535.21

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 45 new files
Database: 1 new table, 7 new options
New tables
wp_aopf_autooffice_settings
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_aopf_autooffice_widget
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Autooffice Plugin
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲6214.58 ▲0.321.76 ▼0.0143.75 ▼2.78
Dashboard /wp-admin2,214 ▲375.55 ▼0.1187.26 ▼12.7184.18 ▲37.70
Posts /wp-admin/edit.php2,137 ▲371.95 ▼0.0836.69 ▼3.8035.03 ▼6.60
Add New Post /wp-admin/post-new.php1,569 ▲4022.03 ▼1.11671.29 ▲52.51173.42 ▲123.36
Media Library /wp-admin/upload.php1,437 ▲404.14 ▼0.05111.32 ▲7.6978.61 ▲32.33
Code Html /wp-admin/admin.php?page=autooffice-html-code8852.1426.9052.63
Code Js /wp-admin/admin.php?page=autooffice-js-code8672.1425.5226.30
Code Css /wp-admin/admin.php?page=autooffice-css-code8632.1427.5329.10
Settings /wp-admin/admin.php?page=autooffice9622.1428.0033.09

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_aopf_autooffice_widget
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=autooffice-html-code
    • > Notice in wp-content/plugins/autooffice/includes/AutoofficeModel.php+235
    Undefined index: stores_name
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=autooffice-html-code
    • > Notice in wp-content/plugins/autooffice/includes/AutoofficeModel.php+243
    Trying to access array offset on value of type null
    • > GET request to /wp-admin/admin.php?page=autooffice-html-code
    • > Notice in wp-content/plugins/autooffice/includes/AutoofficeModel.php+235
    Undefined index: stores_id
    • > GET request to /wp-admin/admin.php?page=autooffice-html-code
    • > Notice in wp-content/plugins/autooffice/includes/AutoofficeModel.php+237
    Undefined index: newsletter
    • > GET request to /wp-admin/admin.php?page=autooffice-html-code
    • > Notice in wp-content/plugins/autooffice/includes/AutoofficeModel.php+239
    Undefined index: advertising
    • > GET request to /wp-admin/admin.php?page=autooffice-html-code
    • > Notice in wp-content/plugins/autooffice/includes/AutoofficeModel.php+243
    Undefined index: subsform

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
Please fix the following
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/autooffice/views/widget_settings_page.php
    • > /wp-content/plugins/autooffice/views/widget_page.php
    • > /wp-content/plugins/autooffice/views/widget.php
  • 8× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/autooffice/autooffice_plugin.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/autooffice/includes/AutoofficeWidget.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/autooffice/views/plugin_settings_page_html.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/autooffice/views/settings_page.php:2
    • > PHP Notice
      Undefined variable: form in wp-content/plugins/autooffice/views/widget.php on line 5
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/autooffice/views/plugin_settings_page.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/autooffice/views/plugin_settings_page_js.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/autooffice/views/plugin_settings_page_css.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
1 plugin tags: autoofficeemail

autooffice/autooffice_plugin.php 85% from 13 tests

Analyzing the main PHP file in "Autooffice Plugin" version 1.0.04
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 477 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("autooffice.php" instead of "autooffice_plugin.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
There were no executable files found in this plugin1,766 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP152711531,272
SVG100288
PO File28183200
CSS2054
JavaScript1052

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.77
Average class complexity28.60
▷ Minimum class complexity11.00
▷ Maximum class complexity78.00
Average method complexity4.21
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods43
▷ Static methods920.93%
▷ Public methods4093.02%
▷ Protected methods36.98%
▷ Private methods00.00%
Functions6
▷ Named functions583.33%
▷ Anonymous functions116.67%
Constants3
▷ Global constants3100.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
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/icon_w.png0.83KB0.89KB0.00%
assets/img/icon.png1.62KB1.36KB▼ 15.54%
assets/img/icon_d.png0.73KB0.83KB0.00%