10% wp-spa

Code Review | WP-SPA

WordPress plugin WP-SPA scored10%from 54 tests.

About plugin

  • Plugin page: wp-spa
  • Plugin version: 1.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.0-4.7.1
  • WordPress version: 6.3.1
  • First release: Dec 28, 2016
  • Latest release: Jan 20, 2017
  • Number of updates: 25
  • Update frequency: every 0.8 days
  • Top authors: khalidhoffman (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,012 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • Install procedure had errors
    • > Notice in wp-content/plugins/wp-spa/includes/class-wp-spa-config.php+165
    Undefined index: siteURL

Server metrics [RAM: ▲0.47MB] [CPU: ▼13.48ms] Passed 4 tests

Analyzing server-side resources used by WP-SPA
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.85 ▲0.3836.79 ▲0.17
Dashboard /wp-admin3.83 ▲0.4842.95 ▼17.74
Posts /wp-admin/edit.php3.86 ▲0.5043.46 ▼6.04
Add New Post /wp-admin/post-new.php6.50 ▲0.6175.23 ▼28.72
Media Library /wp-admin/upload.php3.76 ▲0.5333.64 ▼1.43
WP-SPA Settings /wp-admin/options-general.php?page=wp-spa3.6335.08

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 464 new files
Database: no new tables, 23 new options
New WordPress options
can_compress_scripts
wp_spa_loadingScreenType
wp_spa_enforceSmooth
wp_spa_animationOutDuration
wp_spa_backgroundColor
widget_theysaidso_widget
wp_spa_animationInName
wp_spa_siteURL
wp_spa_animationOutName
widget_recent-comments
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP-SPA
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,746 ▼013.94 ▼0.5928.10 ▲26.4644.92 ▲4.97
Dashboard /wp-admin2,202 ▲305.62 ▼0.1183.46 ▼10.6940.91 ▼2.54
Posts /wp-admin/edit.php2,104 ▲41.96 ▼0.0735.69 ▼5.0934.44 ▲2.49
Add New Post /wp-admin/post-new.php1,529 ▲123.53 ▲0.43680.41 ▲7.7965.40 ▼8.58
Media Library /wp-admin/upload.php1,401 ▲14.24 ▲0.01107.43 ▼3.8242.79 ▼2.76
WP-SPA Settings /wp-admin/options-general.php?page=wp-spa2,3773.39118.5933.88

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
The following items require your attention
  • The uninstall procedure has failed, leaving 23 options in the database
    • wp_spa_captureAll
    • widget_recent-comments
    • wp_spa_animationInName
    • wp_spa_enforceSmooth
    • wp_spa_loadingScreenType
    • wp_spa_animationInDuration
    • wp_spa_animationOutName
    • wp_spa_animationOutDuration
    • wp_spa_json_config
    • wp_spa_backgroundColor
    • ...

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)
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 10× PHP files output text when accessed directly:
    • > /wp-content/plugins/wp-spa/vendor/rmccue/requests/examples/multiple.php
    • > /wp-content/plugins/wp-spa/vendor/rmccue/requests/bin/create_pear_package.php
    • > /wp-content/plugins/wp-spa/vendor/rmccue/requests/examples/cookie_jar.php
    • > /wp-content/plugins/wp-spa/admin/partials/wp-spa-admin-display-heading.php
    • > /wp-content/plugins/wp-spa/public/partials/wp-spa-public-display.php
    • > /wp-content/plugins/wp-spa/vendor/rmccue/requests/examples/post.php
    • > /wp-content/plugins/wp-spa/vendor/rmccue/requests/examples/get.php
    • > /wp-content/plugins/wp-spa/vendor/rmccue/requests/examples/cookie.php
    • > /wp-content/plugins/wp-spa/vendor/rmccue/requests/examples/basic-auth.php
    • > /wp-content/plugins/wp-spa/vendor/rmccue/requests/examples/session.php
  • 246× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\TestCase' not found in wp-content/plugins/wp-spa/vendor/monolog/monolog/tests/Monolog/Handler/CouchDBHandlerTest.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\TestCase' not found in wp-content/plugins/wp-spa/vendor/monolog/monolog/tests/Monolog/Handler/NativeMailerHandlerTest.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/wp-spa/vendor/monolog/monolog/src/Monolog/Handler/CouchDBHandler.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\TestCase' not found in wp-content/plugins/wp-spa/vendor/monolog/monolog/tests/Monolog/Handler/RavenHandlerTest.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/wp-spa/vendor/rmccue/requests/library/Requests/Exception/HTTP/407.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\TestCase' not found in wp-content/plugins/wp-spa/vendor/monolog/monolog/tests/Monolog/Handler/ErrorLogHandlerTest.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\TestCase' not found in wp-content/plugins/wp-spa/vendor/monolog/monolog/tests/Monolog/Handler/FleepHookHandlerTest.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractHandler' not found in wp-content/plugins/wp-spa/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\TestCase' not found in wp-content/plugins/wp-spa/vendor/monolog/monolog/tests/Monolog/Handler/PHPConsoleHandlerTest.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/wp-spa/vendor/rmccue/requests/library/Requests/Exception/HTTP/431.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Donate link: Invalid url: "khalidhoffman.info"
The official readme.txt might help

wp-spa/wp-spa.php 92% from 13 tests

The primary PHP file in "WP-SPA" version 1.3.0 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Text Domain: The text domain should only use lowercase characters and dashes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin35,719 lines of code in 437 files:
LanguageFilesBlank linesComment linesLines of code
PHP3275,06511,42922,646
JavaScript391,0921,2997,498
Markdown2468801,837
HTML45431391,201
CSS661441,039
JSON900566
Stylus127416550
Pug5180179
YAML5175108
XML36079
Bourne Shell24012
Python1104

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity6.74
▷ Minimum class complexity1.00
▷ Maximum class complexity195.00
Average method complexity2.02
▷ Minimum method complexity1.00
▷ Maximum method complexity49.00
Code structure
Namespaces16
Interfaces10
Traits2
Classes308
▷ Abstract classes123.90%
▷ Concrete classes29696.10%
▷ Final classes82.70%
Methods1,859
▷ Static methods1176.29%
▷ Public methods1,55283.49%
▷ Protected methods22512.10%
▷ Private methods824.41%
Functions80
▷ Named functions1620.00%
▷ Anonymous functions6480.00%
Constants81
▷ Global constants33.70%
▷ Class constants7896.30%
▷ Public constants78100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected