68% just-another-saperu-integration

Code Review | Just another Sape.ru integration

WordPress plugin Just another Sape.ru integration scored68%from 54 tests.

About plugin

  • Plugin page: just-another-sape...
  • Plugin version: 2.03
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.4
  • WordPress version: 6.3.1
  • First release: Dec 29, 2015
  • Latest release: Dec 29, 2015
  • Number of updates: 7
  • Update frequency: N/A
  • Top authors: kowack (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active /2,490 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.15MB] [CPU: ▼6.21ms] Passed 4 tests

An overview of server-side resources used by Just another Sape.ru integration
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1548.08 ▼1.38
Dashboard /wp-admin3.45 ▲0.1554.60 ▲2.18
Posts /wp-admin/edit.php3.56 ▲0.2152.48 ▲3.69
Add New Post /wp-admin/post-new.php6.03 ▲0.1490.52 ▼22.80
Media Library /wp-admin/upload.php3.37 ▲0.1439.78 ▼2.85
Statistics /wp-admin/admin.php?page=page_sape_stats3.5839.82
Settings /wp-admin/admin.php?page=page_sape3.3435.11

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 14 new options
New WordPress options
sape_login
sape_user
can_compress_scripts
sape_widget_class
sape_part_is_articles
sape_password
widget_theysaidso_widget
sape_part_is_context
db_upgraded
sape_part_is_client
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Just another Sape.ru integration
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲5914.38 ▲0.031.60 ▼0.6446.64 ▲0.52
Dashboard /wp-admin2,226 ▲465.62 ▼0.0592.46 ▼7.4036.93 ▼5.84
Posts /wp-admin/edit.php2,131 ▲311.99 ▼0.0141.49 ▲2.2635.47 ▼1.87
Add New Post /wp-admin/post-new.php1,553 ▲2522.90 ▼0.13708.25 ▲9.5269.73 ▲17.75
Media Library /wp-admin/upload.php1,431 ▲314.14 ▼0.03107.32 ▲4.6047.25 ▲1.95
Statistics /wp-admin/admin.php?page=page_sape_stats9322.0322.3828.76
Settings /wp-admin/admin.php?page=page_sape9212.0424.4031.88

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/just-another-saperu-integration/just-another-saperu-integration.php+195
    rmdir(wp-content/uploads/.sape): Directory not empty
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_1
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=page_sape_stats
    • > Warning in wp-content/plugins/just-another-saperu-integration/lib/rpc-client.php+38
    Declaration of RPC_Client::query() should be compatible with IXR_Client::query(...$args)
    • > GET request to /wp-admin/admin.php?page=page_sape_stats
    • > Deprecated in wp-content/uploads/.sape/sape.php+21
    Methods with the same name as their class will not be constructors in a future version of PHP; SAPE_base has a deprecated constructor
    • > GET request to /wp-admin/admin.php?page=page_sape_stats
    • > Deprecated in wp-content/uploads/.sape/sape.php+596
    Methods with the same name as their class will not be constructors in a future version of PHP; SAPE_client has a deprecated constructor
    • > GET request to /wp-admin/admin.php?page=page_sape_stats
    • > Deprecated in wp-content/uploads/.sape/sape.php+1149
    Methods with the same name as their class will not be constructors in a future version of PHP; SAPE_context has a deprecated constructor
    • > GET request to /wp-admin/admin.php?page=page_sape_stats
    • > Deprecated in wp-content/uploads/.sape/sape.php+1491
    Methods with the same name as their class will not be constructors in a future version of PHP; SAPE_articles has a deprecated constructor
    • > GET request to /wp-admin/admin.php?page=page_sape_stats
    • > Warning in wp-content/uploads/.sape/sape.php+275
    file_get_contents(http://dispenser-01.saperu.net/code.php?user=&host=wp.com&charset=UTF-8): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request

    • > GET request to /wp-admin/admin.php?page=page_sape_stats
    • > Warning in wp-content/uploads/.sape/sape.php+275
    file_get_contents(http://dispenser-02.saperu.net/code.php?user=&host=wp.com&charset=UTF-8): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request

    • > GET request to /wp-admin/admin.php?page=page_sape_stats
    • > Warning in wp-content/uploads/.sape/sape.php+1081
    array_key_exists() expects parameter 2 to be array, bool given

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
Please fix the following items
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/just-another-saperu-integration/just-another-saperu-integration.php:630
    • > PHP Warning
      Use of undefined constant WPINC - assumed 'WPINC' (this will throw an Error in a future version of PHP) in wp-content/plugins/just-another-saperu-integration/lib/rpc-client.php on line 3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/just-another-saperu-integration/lib/rpc-client.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'IXR_Client' not found in wp-content/plugins/just-another-saperu-integration/lib/rpc-client.php:6
    • > PHP Warning
      include_once(ABSPATHWPINC/class-IXR.php): failed to open stream: No such file or directory in wp-content/plugins/just-another-saperu-integration/lib/rpc-client.php on line 3
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHWPINC/class-IXR.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/just-another-saperu-integration/lib/rpc-client.php on line 3

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

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots require images: #1 (Статистика через API.), #2 (Настройки доступа API.), #3 (Страница настроек плагина.), #4 (Пример виджета.)
The official readme.txt might help

just-another-saperu-integration/just-another-saperu-integration.php 92% from 13 tests

The main PHP file in "Just another Sape.ru integration" ver. 2.03 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin2,086 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP46361,4021,970
PO File14143116

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity49.50
▷ Minimum class complexity3.00
▷ Maximum class complexity108.00
Average method complexity4.72
▷ Minimum method complexity1.00
▷ Maximum method complexity47.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods130
▷ Static methods53.85%
▷ Public methods10782.31%
▷ Protected methods1713.08%
▷ Private methods64.62%
Functions8
▷ Named functions112.50%
▷ Anonymous functions787.50%
Constants1
▷ Global constants1100.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
4 PNG files occupy 0.25MB with 0.17MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png35.10KB12.34KB▼ 64.85%
screenshot-3.png173.79KB46.85KB▼ 73.04%
screenshot-4.png24.72KB7.61KB▼ 69.21%
screenshot-2.png21.29KB6.42KB▼ 69.84%