56% plagia

Code Review | plagia

WordPress plugin plagia scored56%from 54 tests.

About plugin

  • Plugin page: plagia
  • Plugin version: 0.9.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.6
  • WordPress version: 6.3.1
  • First release: Feb 3, 2021
  • Latest release: Feb 17, 2021
  • Number of updates: 26
  • Update frequency: every 0.5 days
  • Top authors: shaymabraham (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,188 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.89MB] [CPU: ▼33.63ms] Passed 4 tests

Analyzing server-side resources used by plagia
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0835.91 ▼2.18
Dashboard /wp-admin3.06 ▼0.2522.55 ▼21.33
Posts /wp-admin/edit.php3.06 ▼0.3024.49 ▼21.49
Add New Post /wp-admin/post-new.php3.06 ▼2.8325.85 ▼67.06
Media Library /wp-admin/upload.php3.06 ▼0.1728.20 ▼24.64
check automatique /wp-admin/admin.php?page=plagia-auto3.0624.09

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 350 new files
Database: 2 new tables, 7 new options
New tables
wp_plagia_rapports
wp_plagia_users
New WordPress options
widget_recent-posts
db_upgraded
can_compress_scripts
plagiarism_version
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by plagia
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,865 ▲13014.12 ▼0.171.76 ▼0.0828.46 ▼16.36
Dashboard /wp-admin2,254 ▲665.63 ▼0.27126.14 ▲28.2646.24 ▲7.49
Posts /wp-admin/edit.php2,137 ▲512.49 ▲0.4948.46 ▲12.9241.30 ▲8.95
Add New Post /wp-admin/post-new.php6,464 ▲4,93128.22 ▲4.81932.17 ▲258.1146.66 ▼7.57
Media Library /wp-admin/upload.php1,436 ▲484.93 ▲0.74101.16 ▼11.1444.92 ▼0.56
check automatique /wp-admin/admin.php?page=plagia-auto1,1672.6551.7236.60

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5905
    Function WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script() function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.)
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • plagiarism_version
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=plagia-auto
    • > User notice in wp-includes/functions.php+5905
    Function WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script() function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.)

SRP 0% 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/plagia/include/dompdf/lib/php-css-parser/tests/quickdump.php
  • 137× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Svg\\Surface\\SurfaceInterface' not found in wp-content/plugins/plagia/include/dompdf/lib/php-svg-lib/src/Svg/Surface/SurfaceGmagick.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Sabberworm\\CSS\\CSSList\\CSSBlockList' not found in wp-content/plugins/plagia/include/dompdf/lib/php-css-parser/lib/Sabberworm/CSS/CSSList/AtRuleBlockList.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Sabberworm\\CSS\\Renderable' not found in wp-content/plugins/plagia/include/dompdf/lib/php-css-parser/lib/Sabberworm/CSS/Value/Value.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Sabberworm\\CSS\\Value\\ValueList' not found in wp-content/plugins/plagia/include/dompdf/lib/php-css-parser/lib/Sabberworm/CSS/Value/CSSFunction.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\TrueType\\TableDirectoryEntry' not found in wp-content/plugins/plagia/include/dompdf/lib/php-font-lib/src/FontLib/OpenType/TableDirectoryEntry.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameReflower\\AbstractFrameReflower' not found in wp-content/plugins/plagia/include/dompdf/src/FrameReflower/Text.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\Positioner\\AbstractPositioner' not found in wp-content/plugins/plagia/include/dompdf/src/Positioner/Inline.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\Positioner\\AbstractPositioner' not found in wp-content/plugins/plagia/include/dompdf/src/Positioner/Absolute.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Svg\\Tag\\AbstractTag' not found in wp-content/plugins/plagia/include/dompdf/lib/php-svg-lib/src/Svg/Tag/LinearGradient.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/plagia/functions.php:9

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=plagia-auto
    • > Network (severe)
    wp-content/plugins/plagia/assets/images/sort_both.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=plagia-auto
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=plagia-auto 0:1 Uncaught SyntaxError: "[object Object]" is not valid JSON

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
2 plugin tags: plagiarism, plagiat

plagia/index.php 85% from 13 tests

The principal PHP file in "plagia" v. 0.9.3 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("plagia.php" instead of "index.php")
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

Code Analysis 97% from 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 plugin47,489 lines of code in 273 files:
LanguageFilesBlank linesComment linesLines of code
PHP1979,10115,45737,669
JavaScript62,3957,0947,119
CSS461441031,189
Markdown62650947
XML632194
JSON500154
PO File14447106
YAML419286
HTML10017
SVG1008

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
It is recommended to fix the following
  • Method cyclomatic complexity should be reduced to less than 100 (currently 652)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity36.54
▷ Minimum class complexity1.00
▷ Maximum class complexity797.00
Average method complexity4.34
▷ Minimum method complexity1.00
▷ Maximum method complexity652.00
Code structure
Namespaces33
Interfaces5
Traits0
Classes181
▷ Abstract classes126.63%
▷ Concrete classes16993.37%
▷ Final classes00.00%
Methods2,046
▷ Static methods1014.94%
▷ Public methods1,76286.12%
▷ Protected methods21010.26%
▷ Private methods743.62%
Functions40
▷ Named functions2562.50%
▷ Anonymous functions1537.50%
Constants177
▷ Global constants31.69%
▷ Class constants17498.31%
▷ Public constants174100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
include/dompdf/lib/res/broken_image.png0.60KB0.47KB▼ 22.33%