66% onoffice-for-wp-websites

Code Review | onOffice for WP-Websites

WordPress plugin onOffice for WP-Websites scored66%from 54 tests.

About plugin

  • Plugin page: onoffice-for-wp-w...
  • Plugin version: 4.15.1
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3.1
  • WordPress version: 6.3.1
  • First release: Oct 14, 2019
  • Latest release: Nov 13, 2023
  • Number of updates: 371
  • Update frequency: every 4.0 days
  • Top authors: jayay (66.58%)onofficeweb (33.69%)

Code review

54 tests

User reviews

1 review

Install metrics

500+ active /22,962 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲3.35MB] [CPU: ▲148.26ms] 75% from 4 tests

A check of server-side resources used by onOffice for WP-Websites
Please take the time to fix the following items
  • CPU: You should keep total CPU usage under 500.00ms (currently 826.80ms on /wp-admin/admin.php?page=onoffice-settings)
PageMemory (MB)CPU Time (ms)
Home /6.39 ▲2.9275.66 ▲34.42
Dashboard /wp-admin6.83 ▲3.52287.03 ▲235.07
Posts /wp-admin/edit.php6.90 ▲3.54240.80 ▲193.82
Add New Post /wp-admin/post-new.php9.38 ▲3.49281.75 ▲187.99
Media Library /wp-admin/upload.php6.70 ▲3.46211.21 ▲176.81
/wp-admin/admin.php?page=onoffice-editlistviewaddress6.69189.70
Estates /wp-admin/admin.php?page=onoffice-estates6.75201.83
Addresses /wp-admin/admin.php?page=onoffice-addresses6.74222.79
/wp-admin/admin.php?page=onoffice-editform6.5058.78
/wp-admin/admin.php?page=onoffice-editlistview7.111,180.50
Settings /wp-admin/admin.php?page=onoffice-settings7.06826.80
Forms /wp-admin/admin.php?page=onoffice-forms6.73210.34
Getting started /wp-admin/admin.php?page=onoffice6.67218.02
/wp-admin/admin.php?page=onoffice-editunitlist6.99357.40

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 1,374 new files
Database: 16 new tables, 15 new options
New tables
wp_oo_plugin_picturetypes
wp_oo_plugin_fieldconfig_form_translated_labels
wp_oo_plugin_fieldconfig_form_customs_labels
wp_oo_plugin_sortbyuservalues
wp_oo_plugin_fieldconfig_form_defaults
wp_oo_plugin_listviews
wp_oo_plugin_form_fieldconfig
wp_oo_plugin_fieldconfig_form_defaults_values
wp_oo_plugin_fieldconfig
wp_oo_plugin_forms
...
New WordPress options
onoffice-settings-honeypot
widget_theysaidso_widget
onoffice-click-button-close-action
theysaidso_admin_options
oo_plugin_db_version
can_compress_scripts
widget_recent-comments
widget_recent-posts
onoffice-detail-view-showTitleUrl
onoffice-settings-title-and-description
...

Browser metrics Passed 4 tests

An overview of browser requirements for onOffice for WP-Websites
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,919 ▲14713.70 ▼0.5719.84 ▲17.7643.32 ▲0.52
Dashboard /wp-admin2,271 ▲915.61 ▲0.0787.11 ▼4.3774.82 ▲32.78
Posts /wp-admin/edit.php2,191 ▲911.98 ▼0.0540.29 ▲1.5736.08 ▲0.41
Add New Post /wp-admin/post-new.php1,760 ▲23422.27 ▼0.71824.20 ▲153.9449.93 ▼7.71
Media Library /wp-admin/upload.php1,488 ▲914.20 ▲0.06109.21 ▲12.1081.68 ▲40.06
/wp-admin/admin.php?page=onoffice-editlistviewaddress310.410.083.93
Estates /wp-admin/admin.php?page=onoffice-estates1,1601.7128.7430.16
Addresses /wp-admin/admin.php?page=onoffice-addresses1,0751.7428.3726.52
/wp-admin/admin.php?page=onoffice-editform450.410.079.50
/wp-admin/admin.php?page=onoffice-editlistview310.410.103.94
Settings /wp-admin/admin.php?page=onoffice-settings1,1331.7026.9333.08
Forms /wp-admin/admin.php?page=onoffice-forms1,1471.6827.8428.65
Getting started /wp-admin/admin.php?page=onoffice8891.6523.5833.85
/wp-admin/admin.php?page=onoffice-editunitlist310.410.063.73

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • recovery_mode_email_last_sent
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=onoffice-editform
    • > Error in wp-content/plugins/onoffice-for-wp-websites/plugin/Gui/AdminPageFormSettingsMain.php+183
    Uncaught TypeError: Argument 1 passed to onOffice\WPlugin\Gui\AdminPageFormSettingsMain::getClassNameByType() must be of the type string, null given, called in wp-content/plugins/onoffice-for-wp-websites/plugin/Gui/AdminPageFormSettingsMain.php on line 76 and defined in wp-content/plugins/onoffice-for-wp-websites/plugin/Gui/AdminPageFormSettingsMain.php:183
    Stack trace:
    #0 wp-content/plugins/onoffice-for-wp-websites/plugin/Gui/AdminPageFormSettingsMain.php(76): onOffice\WPlugin\Gui\AdminPageFormSettingsMain->getClassNameByType()
    #1 wp-content/plugins/onoffice-for-wp-websites/plugin/Gui/AdminPageFormSettingsMain.php(102): onOffice\WPlugin\Gui\AdminPageFormSettingsMain->initSubClass()
    #2 wp-includes/class-wp-hook.php(310): onOffice\WPlugin\Gui\AdminPageFormSettingsMain->initSubClassForGet()
    #3 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(5

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
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/onoffice-for-wp-websites/SDK/example.php
  • 282× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'onOffice\\WPlugin\\Field\\Collection\\FieldCategoryToFieldConverter' not found in wp-content/plugins/onoffice-for-wp-websites/plugin/Field/Collection/FieldCategoryToFieldConverterSearchCriteriaGeoBackend.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'onOffice\\WPlugin\\Gui\\AdminPageSettingsBase' not found in wp-content/plugins/onoffice-for-wp-websites/plugin/Gui/AdminPageEstateListSettingsBase.php:51
    • > PHP Fatal error
      Uncaught Error: Class 'onOffice\\WPlugin\\Renderer\\InputFieldRenderer' not found in wp-content/plugins/onoffice-for-wp-websites/plugin/Renderer/InputFieldEmailRenderer.php:31
    • > PHP Fatal error
      Uncaught Error: Undefined constant 'ABSPATH' in wp-content/plugins/onoffice-for-wp-websites/plugin/Gui/Table/WP/ListTable.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'onOffice\\WPlugin\\Renderer\\InputFieldRenderer' not found in wp-content/plugins/onoffice-for-wp-websites/plugin/Renderer/InputFieldButtonRenderer.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'onOffice\\WPlugin\\Gui\\AdminPageAjax' not found in wp-content/plugins/onoffice-for-wp-websites/plugin/Gui/AdminPageEstateDetail.php:74
    • > PHP Fatal error
      Uncaught Error: Class 'onOffice\\WPlugin\\Field\\DefaultValue\\DefaultValueModelBase' not found in wp-content/plugins/onoffice-for-wp-websites/plugin/Field/DefaultValue/DefaultValueModelBool.php:31
    • > PHP Fatal error
      Uncaught Error: Interface 'DI\\Definition\\Source\\DefinitionSource' not found in wp-content/plugins/onoffice-for-wp-websites/vendor/php-di/php-di/src/Definition/Source/ReflectionBasedAutowiring.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'Invoker\\ParameterResolver\\ParameterResolver' not found in wp-content/plugins/onoffice-for-wp-websites/vendor/php-di/invoker/src/ParameterResolver/Container/TypeHintContainerResolver.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'onOffice\\SDK\\Exception\\SDKException' not found in wp-content/plugins/onoffice-for-wp-websites/SDK/SDK/Exception/HttpFetchNoResultException.php:17

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=onoffice-editlistviewaddress
    • > Network (severe)
    wp-admin/admin.php?page=onoffice-editlistviewaddress - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/admin.php?page=onoffice-editform
    • > Network (severe)
    wp-admin/admin.php?page=onoffice-editform - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/admin.php?page=onoffice-editlistview
    • > Network (severe)
    wp-admin/admin.php?page=onoffice-editlistview - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/admin.php?page=onoffice-editunitlist
    • > Network (severe)
    wp-admin/admin.php?page=onoffice-editunitlist - Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
2 plugin tags: real estate, onoffice

onoffice-for-wp-websites/plugin.php 85% from 13 tests

Analyzing the main PHP file in "onOffice for WP-Websites" version 4.15.1
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 191 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("onoffice-for-wp-websites.php" instead of "plugin.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected141,334 lines of code in 1,239 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript29418,81113,39470,214
PHP55012,26324,43938,712
CSS981,77470610,488
Sass1321,0115344,639
Markdown631,57404,406
PO File82,1153,8174,026
HTML1113603,561
SVG6112,711
YAML367071,068
JSON1600950
Twig24560557
Bourne Shell1002

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Please fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 210)
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity6.95
▷ Minimum class complexity1.00
▷ Maximum class complexity303.00
Average method complexity2.07
▷ Minimum method complexity1.00
▷ Maximum method complexity210.00
Code structure
Namespaces75
Interfaces60
Traits0
Classes458
▷ Abstract classes245.24%
▷ Concrete classes43494.76%
▷ Final classes20.46%
Methods2,986
▷ Static methods1023.42%
▷ Public methods2,35078.70%
▷ Protected methods2237.47%
▷ Private methods41313.83%
Functions138
▷ Named functions2215.94%
▷ Anonymous functions11684.06%
Constants427
▷ Global constants51.17%
▷ Class constants42298.83%
▷ Public constants42099.53%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
83 PNG files occupy 1.15MB with 0.41MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/select2/select2/docs/pages/images/flags/al.png2.56KB1.39KB▼ 45.71%
vendor/select2/select2/docs/themes/site/images/mstile-310x150.png1.25KB1.15KB▼ 8.12%
vendor/select2/select2/docs/themes/site/images/mstile-70x70.png1.51KB1.41KB▼ 6.92%
vendor/select2/select2/docs/pages/images/flags/sd.png10.01KB4.17KB▼ 58.30%
plugin/Gui/resource/mainPage/logo.png136.23KB56.61KB▼ 58.44%