67% firmafy

Code Review | Firmafy

WordPress plugin Firmafy scored67%from 54 tests.

About plugin

  • Plugin page: firmafy
  • Plugin version: 1.1.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.1
  • WordPress version: 6.3.1
  • First release: Jul 28, 2022
  • Latest release: Nov 28, 2023
  • Number of updates: 13
  • Update frequency: every 38.0 days
  • Top authors: closetechnology (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,481 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.19MB] [CPU: ▼0.36ms] Passed 4 tests

This is a short check of server-side resources used by Firmafy
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1740.98 ▼0.37
Dashboard /wp-admin3.48 ▲0.1850.44 ▲1.93
Posts /wp-admin/edit.php3.60 ▲0.2449.54 ▲4.00
Add New Post /wp-admin/post-new.php6.14 ▲0.2589.89 ▼5.05
Media Library /wp-admin/upload.php3.40 ▲0.1833.52 ▲2.06
Settings /wp-admin/admin.php?page=settings_firmafy3.3732.24
Templates /wp-admin/edit.php?post_type=firmafy_template3.5042.00

Server storage [IO: ▲4.01MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 272 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Firmafy
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,836 ▲8914.23 ▼0.121.72 ▲0.0240.41 ▼4.63
Dashboard /wp-admin2,244 ▲645.64 ▼0.0196.92 ▼1.6344.16 ▼2.03
Posts /wp-admin/edit.php2,146 ▲461.98 ▲0.0341.18 ▲3.8735.57 ▼0.42
Add New Post /wp-admin/post-new.php1,550 ▲2423.78 ▲0.40601.88 ▼28.1757.96 ▲3.34
Media Library /wp-admin/upload.php1,449 ▲524.21 ▲0.01100.66 ▲1.6140.86 ▼1.83
Settings /wp-admin/admin.php?page=settings_firmafy9702.0127.9629.04
Templates /wp-admin/edit.php?post_type=firmafy_template1,7301.9738.1730.92

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

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)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 30× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/firmafy/vendor/spipu/html2pdf/examples/res/svg_tree.php
    • > /wp-content/plugins/firmafy/vendor/spipu/html2pdf/examples/res/measure.php
    • > /wp-content/plugins/firmafy/vendor/spipu/html2pdf/examples/res/example13.php
    • > /wp-content/plugins/firmafy/vendor/spipu/html2pdf/examples/res/balloon.php
    • > /wp-content/plugins/firmafy/vendor/spipu/html2pdf/examples/res/example05.php
    • > /wp-content/plugins/firmafy/vendor/spipu/html2pdf/examples/res/forms.php
    • > /wp-content/plugins/firmafy/vendor/spipu/html2pdf/examples/res/bookmark.php
    • > /wp-content/plugins/firmafy/vendor/spipu/html2pdf/examples/res/example09.png.php
    • > /wp-content/plugins/firmafy/vendor/spipu/html2pdf/examples/res/example01.php
    • > /wp-content/plugins/firmafy/vendor/spipu/html2pdf/examples/res/example11.php
  • 135× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/firmafy/vendor/spipu/html2pdf/src/Tests/Parsing/TextParserTest.php:20
    • > PHP Warning
      require_once(wp-content/plugins/firmafy/vendor/spipu/html2pdf/examples/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/firmafy/vendor/spipu/html2pdf/examples/groups.php on line 12
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/firmafy/vendor/spipu/html2pdf/examples/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/firmafy/vendor/spipu/html2pdf/examples/example08.php on line 12
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/firmafy/vendor/spipu/html2pdf/examples/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/firmafy/vendor/spipu/html2pdf/examples/example04.php on line 12
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/firmafy/vendor/spipu/html2pdf/examples/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/firmafy/vendor/spipu/html2pdf/examples/ticket.php on line 12
    • > PHP Fatal error
      Uncaught Error: Class 'Spipu\\Html2Pdf\\Tests\\AbstractTest' not found in wp-content/plugins/firmafy/vendor/spipu/html2pdf/src/Tests/Tag/Svg/PathInvalidTest.php:20
    • > PHP Warning
      require_once(wp-content/plugins/firmafy/vendor/spipu/html2pdf/examples/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/firmafy/vendor/spipu/html2pdf/examples/measure.php on line 12
    • > PHP Fatal error
      Uncaught Error: Class 'Spipu\\Html2Pdf\\Tests\\AbstractTest' not found in wp-content/plugins/firmafy/vendor/spipu/html2pdf/src/Tests/Output/FileNameOkTest.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Spipu\\Html2Pdf\\Tag\\AbstractHtmlTag' not found in wp-content/plugins/firmafy/vendor/spipu/html2pdf/src/Tag/Html/Sup.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Spipu\\Html2Pdf\\Tests\\AbstractTest' not found in wp-content/plugins/firmafy/vendor/spipu/html2pdf/src/Tests/Image/BackgroundOkTest.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Screenshots: These screenshots need descriptions #1, #2, #3, #4 in firmafy/assets to your readme.txt
You can look at the official readme.txt

firmafy/firmafy.php 92% from 13 tests

The main file in "Firmafy" v. 1.1.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Domain Path: The domain path folder does not exist ("/languages")

Code Analysis 0% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Almost there! Just fix the following issues
  • You should never include executable (binary) or otherwise dangerous files in your plugin
    • .ps1 - Windows PowerShell Cmdlet in Windows
      • wp-content/plugins/firmafy/vendor/spipu/html2pdf/test/generate.ps1
62,558 lines of code in 230 files:
LanguageFilesBlank linesComment linesLines of code
PHP1984,10117,45160,838
Markdown1850001,358
JSON400226
SVG20033
CSS21028
XML10422
HTML2122814
PowerShell16614
YAML12013
Bourne Shell14012

PHP code 0% from 2 tests

A short review of cyclomatic complexity and code structure
Please tend to the following items
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 4,413)
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 502)
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity73.53
▷ Minimum class complexity1.00
▷ Maximum class complexity4,413.00
Average method complexity7.37
▷ Minimum method complexity1.00
▷ Maximum method complexity502.00
Code structure
Namespaces19
Interfaces3
Traits0
Classes109
▷ Abstract classes54.59%
▷ Concrete classes10495.41%
▷ Final classes00.00%
Methods1,290
▷ Static methods12910.00%
▷ Public methods82764.11%
▷ Protected methods45435.19%
▷ Private methods90.70%
Functions9
▷ Named functions888.89%
▷ Anonymous functions111.11%
Constants154
▷ Global constants14594.16%
▷ Class constants95.84%
▷ Public constants9100.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
6 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/spipu/html2pdf/src/Tests/Image/res/logo.png20.53KB7.63KB▼ 62.85%
vendor/spipu/html2pdf/examples/res/check.png0.44KB0.39KB▼ 11.16%
vendor/spipu/html2pdf/examples/res/bas_page.png12.68KB5.76KB▼ 54.58%
vendor/spipu/html2pdf/examples/res/off.png0.88KB0.83KB▼ 5.79%
vendor/spipu/html2pdf/examples/res/measure.png0.35KB0.15KB▼ 56.75%