94% anac-xml-viewer

Code Review | ANAC XML Viewer

WordPress plugin ANAC XML Viewer scored 94% from 54 tests.

About plugin

  • Plugin page: anac-xml-viewer
  • Plugin version: 1.6.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-5.5
  • WordPress version: 5.8.1
  • First release: Nov 22, 2015
  • Latest release: May 1, 2020
  • Number of updates: 21
  • Update frequency: every 77.2 days
  • Top authors: Milmor (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

900+ active / 6,840 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.07MB] [CPU: ▼143.55ms] Passed 4 tests

A check of server-side resources used by ANAC XML Viewer
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.90 ▲0.1837.95 ▲14.68
Dashboard /wp-admin3.13 ▲0.0745.63 ▼5.25
Posts /wp-admin/edit.php3.18 ▲0.0746.90 ▼2.56
Add New Post /wp-admin/post-new.php5.49 ▲0.0698.58 ▼558.99
Media Library /wp-admin/upload.php3.07 ▲0.0634.31 ▼7.41
Anac XML /wp-admin/edit.php?post_type=anac-xml-view3.1135.92
Nuovo Dataset /wp-admin/post-new.php?post_type=anac-xml-view3.1157.78

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

ANAC XML Viewer: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,742 ▲14616.21 ▲0.6411.85 ▲2.0048.63 ▼4.70
Dashboard /wp-admin3,024 ▲905.93 ▼0.18145.38 ▼5.54118.69 ▼3.08
Posts /wp-admin/edit.php2,771 ▲322.70 ▲0.0169.61 ▲2.0592.94 ▲2.62
Add New Post /wp-admin/post-new.php1,523 ▼16018.64 ▼0.15397.34 ▼2.80116.04 ▲5.00
Media Library /wp-admin/upload.php1,845 ▲355.07 ▲0.04157.76 ▼8.08126.14 ▲3.29
Anac XML /wp-admin/edit.php?post_type=anac-xml-view1,4462.6367.6783.61
Nuovo Dataset /wp-admin/post-new.php?post_type=anac-xml-view2,0423.1186.62135.11

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstall script ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/anac-xml-viewer/core.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/anac-xml-viewer/anac-xml-viewer.php:11

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

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Tags: There are too many tags (34 tag instead of maximum 10)
You can take inspiration from this readme.txt

anac-xml-viewer/anac-xml-viewer.php Passed 13 tests

Analyzing the main PHP file in "ANAC XML Viewer" version 1.6.1
59 characters long description:
Visualizzatore XML per file generati da applicativi esterni

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
There were no executable files found in this plugin278 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP2429277
JavaScript1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions1173.33%
▷ Anonymous functions426.67%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
wpgov.png0.43KB0.25KB▼ 41.67%
wpg.png21.66KB8.31KB▼ 61.63%