78% centinel-api

Code Review | Centinel API

WordPress plugin Centinel API scored78%from 54 tests.

About plugin

  • Plugin page: centinel-api
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.9
  • WordPress version: 6.3.1
  • First release: Apr 17, 2018
  • Latest release: Apr 17, 2018
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: gtcrais (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /766 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▼0.41MB] [CPU: ▼16.76ms] Passed 4 tests

Server-side resources used by Centinel API
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.77 ▲0.3045.86 ▲4.77
Dashboard /wp-admin3.62 ▲0.2750.92 ▼14.66
Posts /wp-admin/edit.php3.68 ▲0.3150.95 ▲0.70
Add New Post /wp-admin/post-new.php3.44 ▼2.4539.22 ▼57.09
Media Library /wp-admin/upload.php3.48 ▲0.2539.72 ▲4.03
Centinel API Settings /wp-admin/options-general.php?page=centinel-api3.4536.21

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 128 new files
Database: no new tables, 22 new options
New WordPress options
theysaidso_admin_options
centinel_api_timeout
db_upgraded
centinel_api_private_key
widget_recent-comments
centinel_api_zip_password
centinel_api_use_single_transaction
centinel_api_dump_folder
centinel_api_default_character_set
centinel_api_dont_skip_comments
...

Browser metrics Passed 4 tests

A check of browser resources used by Centinel API
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.14 ▼0.131.63 ▼0.0950.78 ▲5.44
Dashboard /wp-admin2,199 ▲225.51 ▼0.1783.69 ▼17.6039.13 ▼1.91
Posts /wp-admin/edit.php2,104 ▲41.99 ▼0.0339.28 ▼0.5936.11 ▲0.18
Add New Post /wp-admin/post-new.php1,538 ▲1018.15 ▼4.87653.77 ▼3.1061.55 ▲7.87
Media Library /wp-admin/upload.php1,407 ▲74.16 ▼0.0396.10 ▼16.0244.00 ▼2.67
Centinel API Settings /wp-admin/options-general.php?page=centinel-api1,0062.0023.6331.88

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • 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
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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/centinel-api/views/inputFields/text.php
    • > /wp-content/plugins/centinel-api/views/inputFields/checkbox.php
  • 96× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'CENTINELPATH/app/Admin/CentinelApiHelpers.php' (include_path='.:/usr/share/php') in wp-content/plugins/centinel-api/app/Admin/CentinelApiInitializer.php on line 3
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Process\\Exception\\ExceptionInterface' not found in wp-content/plugins/centinel-api/vendor/dbDumper151/symfony/process/Exception/RuntimeException.php:19
    • > PHP Warning
      require_once(CENTINELPATH/app/Admin/CentinelApiHelpers.php): failed to open stream: No such file or directory in wp-content/plugins/centinel-api/app/Api/CentinelApiRouteManager.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'CENTINELPATH/app/Admin/CentinelApiZipChecker.php' (include_path='.:/usr/share/php') in wp-content/plugins/centinel-api/app/Admin/CentinelApiAdminRequestHandler.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/centinel-api/vendor/dbDumper151/symfony/process/Tests/ExecutableFinderTest.php:20
    • > PHP Warning
      stream_select(): supplied argument is not a valid stream resource in wp-content/plugins/centinel-api/vendor/dbDumper151/symfony/process/Tests/PipeStdinInStdoutStdErrStreamSelect.php on line 29
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Process\\Exception\\ExceptionInterface' not found in wp-content/plugins/centinel-api/vendor/dbDumper290/symfony/process/Exception/InvalidArgumentException.php:19
    • > PHP Warning
      Use of undefined constant CENTINELPATH - assumed 'CENTINELPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/centinel-api/app/Admin/CentinelApiInitializer.php on line 3
    • > PHP Warning
      stream_select(): supplied argument is not a valid stream resource in wp-content/plugins/centinel-api/vendor/dbDumper151/symfony/process/Tests/PipeStdinInStdoutStdErrStreamSelect.php on line 29
    • > PHP Fatal error
      require_once(): Failed opening required 'CENTINELPATH/app/Api/CentinelApiZipper.php' (include_path='.:/usr/share/php') in wp-content/plugins/centinel-api/app/Admin/CentinelApiZipChecker.php on line 3

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 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: logs, application log check, database backup, database

centinel-api/centinel-api.php 92% from 13 tests

Analyzing the main PHP file in "Centinel API" version 1.0.0
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 271 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin9,224 lines of code in 93 files:
LanguageFilesBlank linesComment linesLines of code
PHP742,1042,9728,167
Markdown122980672
JSON600358
XML13027

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity14.01
▷ Minimum class complexity1.00
▷ Maximum class complexity165.00
Average method complexity2.46
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces8
Interfaces4
Traits0
Classes76
▷ Abstract classes45.26%
▷ Concrete classes7294.74%
▷ Final classes00.00%
Methods736
▷ Static methods445.98%
▷ Public methods64287.23%
▷ Protected methods516.93%
▷ Private methods435.84%
Functions70
▷ Named functions45.71%
▷ Anonymous functions6694.29%
Constants41
▷ Global constants921.95%
▷ Class constants3278.05%
▷ Public constants32100.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 images were found in this plugin