78% sophi

Code Review | Sophi

WordPress plugin Sophi scored78%from 54 tests.

About plugin

  • Plugin page: sophi
  • Plugin version: 1.3.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.2
  • WordPress version: 6.3.1
  • First release: Apr 26, 2021
  • Latest release: Jun 16, 2023
  • Number of updates: 22
  • Update frequency: every 35.6 days
  • Top authors: sophidev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,495 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.39MB] [CPU: ▲0.15ms] Passed 4 tests

Server-side resources used by Sophi
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.89 ▲0.4340.28 ▲1.37
Dashboard /wp-admin3.72 ▲0.4245.90 ▼3.65
Posts /wp-admin/edit.php3.77 ▲0.4248.87 ▲4.81
Add New Post /wp-admin/post-new.php6.24 ▲0.3594.74 ▼1.94
Media Library /wp-admin/upload.php3.58 ▲0.3542.90 ▲5.42

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 260 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Sophi
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.20 ▼1.231.65 ▼0.4838.46 ▼5.97
Dashboard /wp-admin2,203 ▲125.76 ▲0.8897.41 ▼3.8841.19 ▼1.74
Posts /wp-admin/edit.php2,089 ▼01.99 ▲0.0040.01 ▲3.4735.90 ▲2.81
Add New Post /wp-admin/post-new.php1,528 ▲918.37 ▼4.85638.21 ▼36.2859.25 ▲8.63
Media Library /wp-admin/upload.php1,388 ▼04.24 ▼0.00109.77 ▼1.4144.92 ▼5.35

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/sophi/vendor/snowplow/snowplow-tracker/Worker.php
    • > /wp-content/plugins/sophi/vendor/snowplow/snowplow-tracker/tests/bootstrap.php
    • > /wp-content/plugins/sophi/includes/blocks/site-automation-block/markup.php
  • 130× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Brick\\Math\\Internal\\Calculator' not found in wp-content/plugins/sophi/vendor/brick/math/src/Internal/Calculator/BcMathCalculator.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Ramsey\\Collection\\AbstractCollection' not found in wp-content/plugins/sophi/vendor/ramsey/collection/src/AbstractSet.php:25
    • > PHP Fatal error
      Uncaught Error: Interface 'Ramsey\\Collection\\ArrayInterface' not found in wp-content/plugins/sophi/vendor/ramsey/collection/src/Map/MapInterface.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'Ramsey\\Collection\\AbstractArray' not found in wp-content/plugins/sophi/vendor/ramsey/collection/src/GenericArray.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Ramsey\\Collection\\AbstractSet' not found in wp-content/plugins/sophi/vendor/ramsey/collection/src/Set.php:41
    • > PHP Fatal error
      Uncaught Error: Class 'Ramsey\\Uuid\\Uuid' not found in wp-content/plugins/sophi/vendor/ramsey/uuid/src/Guid/Guid.php:51
    • > PHP Fatal error
      Uncaught Error: Interface 'Ramsey\\Uuid\\Exception\\UuidExceptionInterface' not found in wp-content/plugins/sophi/vendor/ramsey/uuid/src/Exception/DceSecurityException.php:23
    • > PHP Fatal error
      Uncaught Error: Interface 'Ramsey\\Uuid\\Builder\\UuidBuilderInterface' not found in wp-content/plugins/sophi/vendor/ramsey/uuid/src/Guid/GuidBuilder.php:32
    • > PHP Fatal error
      Uncaught Error: Interface 'Ramsey\\Uuid\\Generator\\RandomGeneratorInterface' not found in wp-content/plugins/sophi/vendor/ramsey/uuid/src/Generator/RandomLibAdapter.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Snowplow\\Tracker\\Emitters\\SyncEmitter' not found in wp-content/plugins/sophi/includes/classes/Emitter.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

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
9 plugin tags: curator, site automation, artifical intelligence, sophi, collector...

sophi/sophi.php 92% from 13 tests

The principal PHP file in "Sophi" v. 1.3.2 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin14,967 lines of code in 248 files:
LanguageFilesBlank linesComment linesLines of code
PHP2163,84611,24813,154
JSON500749
JavaScript1179124705
Markdown4460187
YAML4210109
Bourne Shell25218
Dockerfile17018
SVG10014
CSS40013

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity7.07
▷ Minimum class complexity1.00
▷ Maximum class complexity89.00
Average method complexity2.09
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces46
Interfaces29
Traits8
Classes152
▷ Abstract classes74.61%
▷ Concrete classes14595.39%
▷ Final classes3020.69%
Methods1,128
▷ Static methods938.24%
▷ Public methods98186.97%
▷ Protected methods221.95%
▷ Private methods12511.08%
Functions151
▷ Named functions10468.87%
▷ Anonymous functions4731.13%
Constants132
▷ Global constants64.55%
▷ Class constants12695.45%
▷ Public constants11188.10%

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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
dist/images/logo.png4.19KB4.16KB▼ 0.54%