68% apprl

Code Review | APPRL

WordPress plugin APPRL scored68%from 54 tests.

About plugin

  • Plugin page: apprl
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6+
  • WordPress version: 6.3.1
  • First release: Sep 5, 2017
  • Latest release: Sep 25, 2017
  • Number of updates: 8
  • Update frequency: every 3.1 days
  • Top authors: apprl (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /786 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼4.25ms] Passed 4 tests

A check of server-side resources used by APPRL
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0244.93 ▲4.54
Dashboard /wp-admin3.39 ▲0.0946.40 ▼4.95
Posts /wp-admin/edit.php3.51 ▲0.1544.88 ▼2.98
Add New Post /wp-admin/post-new.php6.44 ▲0.5686.45 ▼13.61
Media Library /wp-admin/upload.php3.32 ▲0.0939.82 ▲8.99
APPRL /wp-admin/options-general.php?page=apprl-config3.7535.31

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 1,253 new files
Database: no new tables, 9 new options
New WordPress options
apprl_version
widget_theysaidso_widget
widget_recent-comments
apprl_activation_date
apprl_cron_running
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for APPRL
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲7113.41 ▼0.981.81 ▲0.0542.60 ▲1.27
Dashboard /wp-admin2,212 ▲215.88 ▲0.9793.89 ▼10.6744.20 ▲2.92
Posts /wp-admin/edit.php2,095 ▲62.05 ▼0.0235.43 ▼8.2336.22 ▲0.45
Add New Post /wp-admin/post-new.php1,519 ▼2317.77 ▼0.72678.92 ▲72.7556.61 ▼1.57
Media Library /wp-admin/upload.php1,397 ▲94.21 ▲0.00105.17 ▲6.4145.34 ▲3.59
APPRL /wp-admin/options-general.php?page=apprl-config7642.0526.2124.24

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The uninstall procedure has failed, leaving 8 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • apprl_cron_running
    • widget_recent-posts
    • apprl_activation_date
    • theysaidso_admin_options
    • db_upgraded

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)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/apprl/lib/PHPoAuthLib/vendor/squizlabs/php_codesniffer/scripts/build-phar.php
    • > /wp-content/plugins/apprl/lib/PHPoAuthLib/vendor/phpunit/phpunit/build/assertions.php
  • 709× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'PHP_CodeSniffer_Sniff' not found in wp-content/plugins/apprl/lib/PHPoAuthLib/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/WhiteSpace/DisallowSpaceIndentSniff.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'OAuth\\OAuth2\\Service\\AbstractService' not found in wp-content/plugins/apprl/lib/PHPoAuthLib/src/OAuth/OAuth2/Service/Microsoft.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_MockObject_Matcher_StatelessInvocation' not found in wp-content/plugins/apprl/lib/PHPoAuthLib/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Matcher/MethodName.php:60
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/apprl/lib/PHPoAuthLib/vendor/phpunit/php-code-coverage/Tests/_files/NamespaceCoverageClassTest.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/apprl/lib/PHPoAuthLib/vendor/symfony/http-foundation/Tests/StreamedResponseTest.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'OAuth\\OAuth2\\Service\\AbstractService' not found in wp-content/plugins/apprl/lib/PHPoAuthLib/src/OAuth/OAuth2/Service/Vkontakte.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'PHPUnit_Framework_MockObject_Stub' not found in wp-content/plugins/apprl/lib/PHPoAuthLib/vendor/phpunit/phpunit-mock-objects/PHPUnit/Framework/MockObject/Stub/ConsecutiveCalls.php:58
    • > PHP Warning
      require_once(PHP/Token/Stream.php): failed to open stream: No such file or directory in wp-content/plugins/apprl/lib/PHPoAuthLib/vendor/phpunit/php-token-stream/Tests/Token/NamespaceTest.php on line 53
    • > PHP Fatal error
      Uncaught Error: Interface 'PHP_CodeSniffer_Sniff' not found in wp-content/plugins/apprl/lib/PHPoAuthLib/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/DocCommentAlignmentSniff.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'OAuth\\OAuth2\\Service\\AbstractService' not found in wp-content/plugins/apprl/lib/PHPoAuthLib/src/OAuth/OAuth2/Service/Delicious.php:27

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% 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
3 plugin tags: affiliate, fashion, affiliate marketing

apprl/apprl.php 92% from 13 tests

The primary PHP file in "APPRL" version 1.0.3 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 229 characters long)

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Please fix the following items
  • Do not include executable or dangerous files in your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/apprl/lib/PHPoAuthLib/vendor/squizlabs/php_codesniffer/scripts/phpcbf.bat
      • wp-content/plugins/apprl/lib/PHPoAuthLib/vendor/squizlabs/php_codesniffer/scripts/phpcs.bat
92,859 lines of code in 1,166 files:
LanguageFilesBlank linesComment linesLines of code
PHP94450,30297,29481,580
XML1452031284,890
YAML26147893,249
JSON12201,071
Ant41020678
CSS5207168572
Markdown181830486
XSD100251
HTML11043
JavaScript701022
DOS Batch222216
SVG1001

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
The following items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 215)
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity10.52
▷ Minimum class complexity1.00
▷ Maximum class complexity502.00
Average method complexity3.15
▷ Minimum method complexity1.00
▷ Maximum method complexity215.00
Code structure
Namespaces49
Interfaces51
Traits0
Classes979
▷ Abstract classes343.47%
▷ Concrete classes94596.53%
▷ Final classes10.11%
Methods4,784
▷ Static methods3878.09%
▷ Public methods4,06384.93%
▷ Protected methods61612.88%
▷ Private methods1052.19%
Functions211
▷ Named functions15673.93%
▷ Anonymous functions5526.07%
Constants622
▷ Global constants10617.04%
▷ Class constants51682.96%
▷ Public constants516100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
6 compressed PNG files occupy 0.03MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/banner-1544x500.png5.39KB6.10KB0.00%
assets/icon-256x256.png1.91KB3.11KB0.00%
lib/PHPoAuthLib/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/img/glyphicons-halflings.png12.50KB10.35KB▼ 17.19%
assets/icon-128x128.png0.98KB1.72KB0.00%
lib/PHPoAuthLib/vendor/phpunit/php-code-coverage/PHP/CodeCoverage/Report/HTML/Renderer/Template/img/glyphicons-halflings-white.png8.57KB9.20KB0.00%