10% calcfusion-for-wp

Code Review | CalcFusion for WP

WordPress plugin CalcFusion for WP scored10%from 54 tests.

About plugin

  • Plugin page: calcfusion-for-wp
  • Plugin version: 1.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.1
  • WordPress version: 6.3.1
  • First release: Jan 13, 2015
  • Latest release: Oct 15, 2015
  • Number of updates: 78
  • Update frequency: every 3.6 days
  • Top authors: CalcFusion (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,057 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/calcfusion-for-wp/calcfusion-for-wp.php+193
    Only variables should be passed by reference

Server metrics [RAM: ▼1.74MB] [CPU: ▼52.02ms] Passed 4 tests

This is a short check of server-side resources used by CalcFusion for WP
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0942.60 ▲0.82
Dashboard /wp-admin2.20 ▼1.106.05 ▼43.61
Posts /wp-admin/edit.php2.20 ▼1.156.00 ▼41.91
Add New Post /wp-admin/post-new.php2.20 ▼3.685.44 ▼93.01
Media Library /wp-admin/upload.php2.20 ▼1.035.55 ▼29.56
CalcFusion /wp-admin/options-general.php?page=calcfusion-for-wp2.205.98

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 252 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for CalcFusion for WP
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲5114.35 ▼0.221.73 ▼0.1045.10 ▼0.83
Dashboard /wp-admin2,206 ▲325.57 ▼0.0189.27 ▼1.7942.38 ▲2.34
Posts /wp-admin/edit.php2,108 ▲82.02 ▲0.0233.68 ▼2.4835.02 ▼0.09
Add New Post /wp-admin/post-new.php1,533 ▲723.72 ▲0.67647.55 ▼37.7952.97 ▼5.46
Media Library /wp-admin/upload.php1,403 ▼04.22 ▲0.04100.98 ▼12.6244.32 ▼4.49
CalcFusion /wp-admin/options-general.php?page=calcfusion-for-wp9902.3223.6134.27

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=calcfusion-for-wp
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=calcfusion-for-wp
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the json2 handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=calcfusion-for-wp
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the cf_sha1_script handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)

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
Please fix the following items
  • 5× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/calcfusion-for-wp/uploadcomplete.php
    • > /wp-content/plugins/calcfusion-for-wp/core/vendor/nategood/httpful/tests/bootstrap-server.php
    • > /wp-content/plugins/calcfusion-for-wp/core/vendor/nategood/httpful/examples/github.php
    • > /wp-content/plugins/calcfusion-for-wp/core/vendor/nategood/httpful/examples/freebase.php
    • > /wp-content/plugins/calcfusion-for-wp/core/vendor/nategood/httpful/examples/showclix.php
  • 159× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/calcfusion-for-wp/core/vendor/guzzlehttp/guzzle/tests/QueryParserTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/calcfusion-for-wp/core/vendor/guzzlehttp/guzzle/tests/Event/RequestBeforeSendEventTest.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Event\\SubscriberInterface' not found in wp-content/plugins/calcfusion-for-wp/core/vendor/guzzlehttp/guzzle/src/Subscriber/HttpError.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Event\\SubscriberInterface' not found in wp-content/plugins/calcfusion-for-wp/core/vendor/guzzlehttp/guzzle/src/Subscriber/History.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/calcfusion-for-wp/core/vendor/guzzlehttp/guzzle/tests/Message/MessageFactoryTest.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/calcfusion-for-wp/core/vendor/guzzlehttp/guzzle/tests/Event/ErrorEventTest.php:14
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/calcfusion-for-wp/core/vendor/nategood/httpful/examples/showclix.php on line 24
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/calcfusion-for-wp/core/vendor/guzzlehttp/streams/tests/FnStreamTest.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/calcfusion-for-wp/core/vendor/guzzlehttp/guzzle/tests/MimetypesTest.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\TransferException' not found in wp-content/plugins/calcfusion-for-wp/core/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
1 plugin tags: computation engine

calcfusion-for-wp/calcfusion-for-wp.php 85% from 13 tests

The main file in "CalcFusion for WP" v. 1.1.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Domain Path: The domain path folder does not exist ("/languages/")
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin22,606 lines of code in 238 files:
LanguageFilesBlank linesComment linesLines of code
PHP2023,1145,80418,466
Markdown542601,827
reStructuredText129801,2331,597
JavaScript21838227
make3435179
JSON650160
YAML310053
Python1222348
XML31046
HTML1003

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity6.58
▷ Minimum class complexity1.00
▷ Maximum class complexity73.00
Average method complexity1.77
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces29
Interfaces22
Traits4
Classes172
▷ Abstract classes52.91%
▷ Concrete classes16797.09%
▷ Final classes21.20%
Methods1,590
▷ Static methods976.10%
▷ Public methods1,43890.44%
▷ Protected methods352.20%
▷ Private methods1177.36%
Functions151
▷ Named functions3120.53%
▷ Anonymous functions12079.47%
Constants118
▷ Global constants1411.86%
▷ Class constants10488.14%
▷ Public constants104100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.25MB with 0.13MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/CalcFusion_logo.png8.47KB4.07KB▼ 51.96%
core/vendor/guzzlehttp/guzzle/docs/_static/logo.png241.87KB69.68KB▼ 71.19%
core/vendor/guzzlehttp/guzzle/docs/_static/guzzle-icon.png0.78KB0.94KB0.00%
images/ico24_download.png3.02KB0.23KB▼ 92.39%