94% wp-upstream

Code Review | WP Upstream

WordPress plugin WP Upstream scored 94% from 54 tests.

About plugin

  • Plugin page: wp-upstream
  • Plugin version: 0.1.8
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.6
  • WordPress version: 5.9.2
  • First release: Aug 21, 2015
  • Latest release: Jun 8, 2018
  • Number of updates: 5
  • Update frequency: every 205.6 days
  • Top authors: andypotanin (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active / 1,491 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼301.15ms] Passed 4 tests

Analyzing server-side resources used by WP Upstream
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.0999.54 ▲40.51
Dashboard /wp-admin3.43 ▲0.0340.57 ▼0.19
Posts /wp-admin/edit.php3.66 ▲0.0244.70 ▼6.56
Add New Post /wp-admin/post-new.php6.90 ▼0.0798.93 ▼1,195.01
Media Library /wp-admin/upload.php3.31 ▲0.0231.06 ▼2.85

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 101 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by WP Upstream
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,821 ▲6715.13 ▼0.545.94 ▼0.382.01 ▼0.85
Dashboard /wp-admin2,935 ▲776.12 ▲0.01115.99 ▼17.44162.88 ▼1.04
Posts /wp-admin/edit.php2,731 ▲433.23 ▼0.0164.23 ▼11.89149.74 ▼19.62
Add New Post /wp-admin/post-new.php1,786 ▲3416.95 ▼4.09428.46 ▼12.04156.55 ▼4.80
Media Library /wp-admin/upload.php1,741 ▲405.53 ▲0.01141.63 ▲4.09196.51 ▲10.66

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% 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)
Even though no errors were found, this is by no means an exhaustive test

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
The following issues need your attention
  • 66× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\Test\\TestCase' not found in wp-content/plugins/wp-upstream/vendor/composer/installers/tests/Composer/Installers/Test/PiwikInstallerTest.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/wp-upstream/vendor/composer/installers/src/Composer/Installers/LaravelInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/wp-upstream/vendor/composer/installers/src/Composer/Installers/MakoInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-upstream/vendor/composer/installers/tests/Composer/Installers/Test/AsgardInstallerTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/wp-upstream/vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/wp-upstream/vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/wp-upstream/vendor/composer/installers/src/Composer/Installers/DokuWikiInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/wp-upstream/vendor/composer/installers/src/Composer/Installers/PPIInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/wp-upstream/vendor/composer/installers/src/Composer/Installers/TuskInstaller.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/wp-upstream/vendor/composer/installers/src/Composer/Installers/JoomlaInstaller.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
7 plugin tags: version management, updates, svn, commit, push...

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

This is the main PHP file of "WP Upstream" version 0.1.8, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected4,040 lines of code in 95 files:
LanguageFilesBlank linesComment linesLines of code
PHP856439793,457
JSON400257
Markdown3480212
JavaScript191980
XML12023
YAML13011

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity5.85
▷ Minimum class complexity1.00
▷ Maximum class complexity66.00
Average method complexity3.14
▷ Minimum method complexity1.00
▷ Maximum method complexity46.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes78
▷ Abstract classes22.56%
▷ Concrete classes7697.44%
▷ Final classes67.89%
Methods180
▷ Static methods2916.11%
▷ Public methods12167.22%
▷ Protected methods2614.44%
▷ Private methods3318.33%
Functions19
▷ Named functions1368.42%
▷ Anonymous functions631.58%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected