78% culture-object

Code Review | Culture Object

WordPress plugin Culture Object scored 78% from 54 tests.

About plugin

  • Plugin page: culture-object
  • Plugin version: 4.1.1
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.0.1
  • WordPress version: 6.3.1
  • First release: Dec 20, 2015
  • Latest release: Aug 24, 2022
  • Number of updates: 21
  • Update frequency: every 117.4 days
  • Top authors: lgladdy (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

60+ active / 2,816 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.25MB] [CPU: ▼4.84ms] Passed 4 tests

This is a short check of server-side resources used by Culture Object
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.2338.71 ▼1.65
Dashboard /wp-admin3.54 ▲0.2347.72 ▼8.15
Posts /wp-admin/edit.php3.65 ▲0.2950.01 ▲1.74
Add New Post /wp-admin/post-new.php6.18 ▲0.2985.70 ▼11.30
Media Library /wp-admin/upload.php3.46 ▲0.2335.52 ▲1.80
Provider Settings /wp-admin/admin.php?page=cos_provider_settings3.4334.30
Objects /wp-admin/edit.php?post_type=object3.5040.00
Add New /wp-admin/post-new.php?post_type=object3.5249.18
Main Settings /wp-admin/admin.php?page=cos_settings6.5458.81

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 496 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
cos_core_sync_key
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Culture Object
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,857 ▲12213.60 ▼0.691.78 ▼0.1438.18 ▼5.11
Dashboard /wp-admin2,257 ▲665.82 ▼0.0397.63 ▼14.0335.79 ▼17.21
Posts /wp-admin/edit.php2,143 ▲512.00 ▼0.0536.01 ▼1.4430.34 ▼2.94
Add New Post /wp-admin/post-new.php1,587 ▲6123.25 ▲0.16644.31 ▲25.8458.18 ▲2.10
Media Library /wp-admin/upload.php1,445 ▲604.23 ▲0.05101.08 ▼6.5847.72 ▲4.11
Provider Settings /wp-admin/admin.php?page=cos_provider_settings8472.0427.3131.91
Objects /wp-admin/edit.php?post_type=object1,1192.0137.6631.21
Add New /wp-admin/post-new.php?post_type=object1,7583.5263.7536.18
Main Settings /wp-admin/admin.php?page=cos_settings9282.0428.4939.96

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • cos_core_sync_key
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% 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 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
  • 5× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/culture-object/providers/CSV2/vendor/markbaker/complex/examples/complexTest.php
    • > /wp-content/plugins/culture-object/providers/CSV2/vendor/markbaker/complex/examples/testFunctions.php
    • > /wp-content/plugins/culture-object/providers/CSV2/vendor/markbaker/matrix/examples/test.php
    • > /wp-content/plugins/culture-object/providers/CSV2/vendor/markbaker/matrix/buildPhar.php
    • > /wp-content/plugins/culture-object/providers/CSV2/vendor/markbaker/complex/examples/testOperations.php
  • 138× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpSpreadsheet\\Chart\\Properties' not found in wp-content/plugins/culture-object/providers/CSV2/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Axis.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpSpreadsheet\\Worksheet\\Drawing' not found in wp-content/plugins/culture-object/providers/CSV2/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/HeaderFooterDrawing.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpSpreadsheet\\Reader\\BaseReader' not found in wp-content/plugins/culture-object/providers/CSV2/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls.php:61
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpSpreadsheet\\Writer\\BaseWriter' not found in wp-content/plugins/culture-object/providers/CSV2/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\WriterPart' not found in wp-content/plugins/culture-object/providers/CSV2/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/DocProps.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\WriterPart' not found in wp-content/plugins/culture-object/providers/CSV2/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Style.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx\\BaseParserClass' not found in wp-content/plugins/culture-object/providers/CSV2/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/ColumnAndRowAttributes.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpSpreadsheet\\Writer\\BaseWriter' not found in wp-content/plugins/culture-object/providers/CSV2/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Csv.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpSpreadsheet\\Cell\\DefaultValueBinder' not found in wp-content/plugins/culture-object/providers/CSV2/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/AdvancedValueBinder.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'PhpOffice\\PhpSpreadsheet\\IComparable' not found in wp-content/plugins/culture-object/providers/CSV2/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/BaseDrawing.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
6 plugin tags: object, sync, collections, culture, objects...

culture-object/CultureObject.php 92% from 13 tests

"Culture Object" version 4.1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("culture-object.php" instead of "CultureObject.php")

Code Analysis 95% from 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
Good job! No executable or dangerous file extensions detected73,323 lines of code in 434 files:
LanguageFilesBlank linesComment linesLines of code
PHP38314,71233,03069,950
JSON14001,276
Markdown2242201,134
CSS443152472
JavaScript5410394
XML314177
YAML30020

PHP code 0% from 2 tests

An overview of cyclomatic complexity and code structure
It is recommended to fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 1,022)
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 387)
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity35.86
▷ Minimum class complexity1.00
▷ Maximum class complexity1,022.00
Average method complexity4.08
▷ Minimum method complexity1.00
▷ Maximum method complexity387.00
Code structure
Namespaces58
Interfaces27
Traits0
Classes285
▷ Abstract classes207.02%
▷ Concrete classes26592.98%
▷ Final classes41.51%
Methods3,632
▷ Static methods79922.00%
▷ Public methods2,81977.62%
▷ Protected methods1052.89%
▷ Private methods70819.49%
Functions121
▷ Named functions10586.78%
▷ Anonymous functions1613.22%
Constants850
▷ Global constants60.71%
▷ Class constants84499.29%
▷ Public constants84399.88%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin