78% wp-azure-offload

Code Review | WP Azure offload

WordPress plugin WP Azure offload scored78%from 54 tests.

About plugin

  • Plugin page: wp-azure-offload
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.2.2
  • WordPress version: 6.3.1
  • First release: Aug 25, 2017
  • Latest release: Aug 9, 2019
  • Number of updates: 10
  • Update frequency: every 71.4 days
  • Top authors: promact (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /2,561 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.29MB] [CPU: ▲0.41ms] Passed 4 tests

Analyzing server-side resources used by WP Azure offload
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.3349.68 ▲2.20
Dashboard /wp-admin3.63 ▲0.3354.66 ▲2.68
Posts /wp-admin/edit.php3.68 ▲0.3254.26 ▲5.23
Add New Post /wp-admin/post-new.php6.15 ▲0.2691.18 ▼8.49
Media Library /wp-admin/upload.php3.49 ▲0.2641.32 ▲5.45

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 895 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by WP Azure offload
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,801 ▲4014.34 ▲0.071.54 ▼0.2639.65 ▼4.25
Dashboard /wp-admin2,207 ▲305.56 ▼0.1185.72 ▼4.8640.04 ▼2.45
Posts /wp-admin/edit.php2,112 ▲92.01 ▲0.0636.45 ▲0.0535.43 ▼3.65
Add New Post /wp-admin/post-new.php1,538 ▲1223.01 ▼0.80660.16 ▲38.6657.04 ▲10.52
Media Library /wp-admin/upload.php1,415 ▲184.20 ▼0.01106.56 ▼34.1943.35 ▼4.67

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 12× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/wp-azure-offload/vendor/pear/http_request2/tests/_network/incompletebody.php
    • > /wp-content/plugins/wp-azure-offload/vendor/pear/http_request2/tests/_network/bug20228.php
    • > /wp-content/plugins/wp-azure-offload/vendor/firebase/php-jwt/tests/bootstrap.php
    • > /wp-content/plugins/wp-azure-offload/vendor/pear/http_request2/tests/_network/getparameters.php
    • > /wp-content/plugins/wp-azure-offload/vendor/pear/http_request2/tests/_network/download.php
    • > /wp-content/plugins/wp-azure-offload/vendor/microsoft/windowsazure/build/release_tools.php
    • > /wp-content/plugins/wp-azure-offload/vendor/pear/http_request2/tests/_network/setcookie.php
    • > /wp-content/plugins/wp-azure-offload/vendor/pear/http_request2/tests/_network/bug19934.php
    • > /wp-content/plugins/wp-azure-offload/vendor/pear/http_request2/tests/_network/postparameters.php
    • > /wp-content/plugins/wp-azure-offload/view/footer.php
  • 572× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-azure-offload/vendor/microsoft/windowsazure/tests/unit/WindowsAzure/ServiceManagement/Models/RoleInstanceTest.php:39
    • > PHP Fatal error
      Uncaught Error: Class 'Tests\\Framework\\ServiceRestProxyTestBase' not found in wp-content/plugins/wp-azure-offload/vendor/microsoft/windowsazure/tests/framework/BlobServiceRestProxyTestBase.php:42
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-azure-offload/vendor/microsoft/windowsazure/tests/unit/WindowsAzure/Blob/Models/CopyBlobOptionsTest.php:41
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-azure-offload/vendor/microsoft/windowsazure/tests/unit/WindowsAzure/Common/Models/OAuthAccessTokenTest.php:41
    • > PHP Fatal error
      Uncaught Error: Class 'WindowsAzure\\Table\\Models\\TableServiceOptions' not found in wp-content/plugins/wp-azure-offload/vendor/microsoft/windowsazure/WindowsAzure/Table/Models/QueryEntitiesOptions.php:38
    • > PHP Fatal error
      Uncaught Error: Class 'Tests\\Functional\\WindowsAzure\\Table\\FunctionalTestBase' not found in wp-content/plugins/wp-azure-offload/vendor/microsoft/windowsazure/tests/functional/WindowsAzure/Table/TableServiceFunctionalQueryTest.php:36
    • > PHP Fatal error
      Uncaught Error: Interface 'WindowsAzure\\Common\\Internal\\IServiceFilter' not found in wp-content/plugins/wp-azure-offload/vendor/microsoft/windowsazure/WindowsAzure/Common/Internal/Filters/DateFilter.php:40
    • > PHP Fatal error
      Uncaught Error: Class 'Tests\\Framework\\QueueServiceRestProxyTestBase' not found in wp-content/plugins/wp-azure-offload/vendor/microsoft/windowsazure/tests/unit/WindowsAzure/Queue/QueueRestProxyTest.php:53
    • > PHP Fatal error
      Uncaught Error: Class 'Tests\\Framework\\ServiceBusRestProxyTestBase' not found in wp-content/plugins/wp-azure-offload/vendor/microsoft/windowsazure/tests/unit/WindowsAzure/ServiceBus/ServiceBusRestProxyTest.php:62
    • > PHP Fatal error
      Uncaught Error: Class 'Tests\\Framework\\ServiceRestProxyTestBase' not found in wp-content/plugins/wp-azure-offload/vendor/microsoft/windowsazure/tests/unit/WindowsAzure/Common/ServicesBuilderTest.php:45

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Screenshots: Please add images for these screenshots: #1 (Azure storage account configuration), #2 (Manually add storage), #3 (Browse existing storage containers), #4 (Create new storage container), #5 (The settings after adding storage container), #6 (Media handlers at media library list view if copy diles to azure storage and serve files using CDN url is checked)
You can look at the official readme.txt

wp-azure-offload/wp-azure-offload.php Passed 13 tests

The main PHP script in "WP Azure offload" version 2.0 is automatically included on every request by WordPress
66 characters long description:
Automatically copies media to Azure storage and deliver using CDN.

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
Everything looks great! No dangerous files found in this plugin93,666 lines of code in 857 files:
LanguageFilesBlank linesComment linesLines of code
PHP80720,32969,25686,577
XML147973,045
JavaScript42113591,740
JSON1000810
Markdown72680723
CSS1281371
Ant12532149
YAML7710113
XSLT115253
reStructuredText216234
Bourne Shell13431
DTD13016
make1404

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity7.59
▷ Minimum class complexity1.00
▷ Maximum class complexity318.00
Average method complexity1.82
▷ Minimum method complexity1.00
▷ Maximum method complexity54.00
Code structure
Namespaces71
Interfaces25
Traits0
Classes711
▷ Abstract classes70.98%
▷ Concrete classes70499.02%
▷ Final classes00.00%
Methods6,131
▷ Static methods5488.94%
▷ Public methods5,66492.38%
▷ Protected methods1582.58%
▷ Private methods3095.04%
Functions44
▷ Named functions3068.18%
▷ Anonymous functions1431.82%
Constants721
▷ Global constants294.02%
▷ Class constants69295.98%
▷ Public constants692100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin