68% conoha-object-sync

Code Review | ConoHa Object Sync

WordPress plugin ConoHa Object Sync scored68%from 54 tests.

About plugin

  • Plugin page: conoha-object-sync
  • Plugin version: 0.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.2.2
  • WordPress version: 6.3.1
  • First release: Mar 18, 2015
  • Latest release: Nov 25, 2015
  • Number of updates: 15
  • Update frequency: every 16.8 days
  • Top authors: hironobu (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,271 total downloads

Benchmarks

Plugin footprint 65% 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.66MB] [CPU: ▼33.54ms] Passed 4 tests

Analyzing server-side resources used by ConoHa Object Sync
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.3046.04 ▲0.24
Dashboard /wp-admin3.29 ▼0.0228.54 ▼33.87
Posts /wp-admin/edit.php3.29 ▼0.0726.77 ▼19.96
Add New Post /wp-admin/post-new.php3.29 ▼2.6028.59 ▼68.61
Media Library /wp-admin/upload.php3.29 ▲0.0525.21 ▼11.73
ConoHa Object Sync /wp-admin/options-general.php?page=conoha-object-sync/conoha-ojs-sync.php3.2924.62

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 1,411 new files
Database: no new tables, 10 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
conohaojs-servicename
conohaojs-auth-url
db_upgraded
conohaojs-region
can_compress_scripts
widget_recent-comments
conohaojs-delobject
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for ConoHa Object Sync
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.28 ▼0.111.54 ▼0.2443.55 ▼2.67
Dashboard /wp-admin2,199 ▲195.64 ▼0.0284.20 ▼15.9538.61 ▼1.19
Posts /wp-admin/edit.php2,107 ▲71.99 ▲0.0534.20 ▼10.4936.17 ▼0.32
Add New Post /wp-admin/post-new.php1,531 ▲523.11 ▲0.04592.71 ▼43.4847.54 ▼20.18
Media Library /wp-admin/upload.php1,407 ▲44.24 ▲0.06102.56 ▼1.7443.41 ▼0.15
ConoHa Object Sync /wp-admin/options-general.php?page=conoha-object-sync/conoha-ojs-sync.php1,0022.0224.3435.74

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • Uninstall procedure had uncaught errors
    • > 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 has failed, leaving 10 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • conohaojs-servicename
    • conohaojs-region
    • conohaojs-auth-url
    • theysaidso_admin_options
    • conohaojs-delobject

Smoke tests 50% 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)
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=conoha-object-sync/conoha-ojs-sync.php
    • > 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.

SRP 50% 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 fix the following
  • 1090× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Guzzle\\Tests\\GuzzleTestCase' not found in wp-content/plugins/conoha-object-sync/vendor/guzzle/guzzle/tests/Guzzle/Tests/Http/QueryAggregator/DuplicateAggregatorTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'OpenCloud\\LoadBalancer\\Resource\\AbstractResource' not found in wp-content/plugins/conoha-object-sync/vendor/rackspace/php-opencloud/lib/OpenCloud/LoadBalancer/Resource/ContentCaching.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/conoha-object-sync/vendor/rackspace/php-opencloud/tests/OpenCloud/Tests/Common/Log/LoggerTest.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Guzzle\\Tests\\GuzzleTestCase' not found in wp-content/plugins/conoha-object-sync/vendor/guzzle/guzzle/tests/Guzzle/Tests/Plugin/Cache/DefaultCanCacheStrategyTest.php:12
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/conoha-object-sync/vendor/rackspace/php-opencloud/samples/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/conoha-object-sync/vendor/rackspace/php-opencloud/samples/Networking/create-security-group.php on line 18
    • > PHP Fatal error
      Uncaught Error: Class 'Guzzle\\Tests\\GuzzleTestCase' not found in wp-content/plugins/conoha-object-sync/vendor/guzzle/guzzle/tests/Guzzle/Tests/Common/CollectionTest.php:12
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/conoha-object-sync/vendor/rackspace/php-opencloud/samples/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/conoha-object-sync/vendor/rackspace/php-opencloud/samples/ObjectStore/cleanup.php on line 18
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/conoha-object-sync/vendor/rackspace/php-opencloud/samples/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/conoha-object-sync/vendor/rackspace/php-opencloud/samples/Compute/detach_volume.php on line 19
    • > PHP Fatal error
      Uncaught Error: Class 'OpenCloud\\CloudMonitoring\\Resource\\ReadOnlyResource' not found in wp-content/plugins/conoha-object-sync/vendor/rackspace/php-opencloud/lib/OpenCloud/CloudMonitoring/Resource/AgentConnection.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'OpenCloud\\Smoke\\Unit\\AbstractUnit' not found in wp-content/plugins/conoha-object-sync/vendor/rackspace/php-opencloud/tests/OpenCloud/Smoke/Unit/DNS.php:22

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Add an image for screenshot #1 (Edit settings through the 'Settings' menu as you like.)
The official readme.txt is a good inspiration

conoha-object-sync/conoha-ojs-sync.php 85% from 13 tests

The main PHP script in "ConoHa Object Sync" version 0.2.1 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("conoha-object-sync.php" instead of "conoha-ojs-sync.php")
  • 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 glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected68,472 lines of code in 1,227 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,08713,36630,55258,312
Markdown792,69107,335
JSON437301,920
YAML6600373
XML63612266
JavaScript21839130
PO File1251680
Ant110134
Bourne Shell16217
CSS1005

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity4.91
▷ Minimum class complexity1.00
▷ Maximum class complexity112.00
Average method complexity1.68
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces194
Interfaces85
Traits2
Classes923
▷ Abstract classes475.09%
▷ Concrete classes87694.91%
▷ Final classes20.23%
Methods5,986
▷ Static methods2323.88%
▷ Public methods5,49791.83%
▷ Protected methods3836.40%
▷ Private methods1061.77%
Functions198
▷ Named functions2412.12%
▷ Anonymous functions17487.88%
Constants417
▷ Global constants30.72%
▷ Class constants41499.28%
▷ Public constants414100.00%

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 PNG file occupies 0.21MB with 0.14MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png219.06KB71.98KB▼ 67.14%