GithubHelp home page GithubHelp logo

forumpostassistant / fpa Goto Github PK

View Code? Open in Web Editor NEW
25.0 12.0 15.0 3.38 MB

The Forum Post Assistant (FPA) script has been developed to assist Joomla!® forum posters to be able to post relevant system, instance, PHP and troubleshooting information directly in to a pre-formatted forum post. This will save a few hours of posting back and forth, asking for, and explaining how to acquire useful information in order for other forum users to help troubleshoot a problem.

Home Page: https://forumpostassistant.github.io/docs/

License: GNU General Public License v2.0

PHP 100.00%
joomla diagnostic self-help troubleshooting fpa forum

fpa's Introduction

Forum Post Assistant (FPA)


The Forum Post Assistant has been designed to assist newcomers to the forum to be able to post relevant system, instance, php and troubleshooting information directly in to a pre-formatted forum post. This should save a few hours of too'ing and fro-ing asking for, and explaining, how to acquire useful information in order to help troubleshoot a problem.


This process also means that consistent information is gathered and presented in every case, enabling helpers to quickly target information relevant to the specific problem observed by the user.

The idea is to make the information collection, and subsequent posting, as simple as possible for the end user, a simple one page script, automatically collects the information when run in a web-browser and presents the user with the option to include or exclude any site sensitive information before "generating" the post [BB]code that can then be copied and simply pasted in to a new or existing forum post with no other interaction by the user required after posting.


Joomla & PHP Version Support

All supported Joomla! versions running on PHP v5.4 and above


Multilanguage Version

Multilanguage support is a work-in-progress. The FPA is available only in the English language from this repository. If you would like to contribute to translating the FPA into other languages, head over to Crowdin.

fpa's People

Contributors

btoplak avatar elkuku avatar frostmakk avatar mandville avatar phild13 avatar russw avatar sophist-uk avatar sozzled avatar webdongle avatar ygotame avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fpa's Issues

FPA filename is defined differently, in two places

In https://github.com/ForumPostAssistant/FPA/tree/2020-UI-Facelift,

lines 103-108
` //$fpafile = _FPA_SELF;
$fpafile = 'fred.php';

    if ( file_exists($fpafile) ) {
        $fileinfo = stat( $fpafile );
    }

and, again, lines 514-552 //$fpaFilename = _FPA_SELF;
$fpaFilename = 'fred.php';

    // try to set script to 777 to make sure we have permission to delete
    @chmod($fpaFilename, 0777);  // octal; correct value of mode

    // Delete the file.
    @unlink($fpaFilename);

    // Message and link to home page of site.
    // if SSL return to https:// otherwise http://
    if ( @$_SERVER['HTTPS'] == 'on' ? $hostPrefix = 'https://' : $hostPrefix = 'http://');
    $page = $hostPrefix . $host;

    // Something went wrong and the script was not deleted so it must be removed manually so we tell the user to do so - PhilD 8-07-12
    if ( file_exists($fpaFilename) ) {
        @chmod($fpaFilename, 0644);  // octal; correct value of mode

        echo '<div id="deleteMessage" style="padding:20px;border:1px solid #e99002;background-color:#fff8ee;margin:0 auto;margin-top:50px;margin-bottom:20px;max-width:70%;position:relative;z-index:9999;top:10%;font-family:sans-serif, arial;" align="center">';
        echo '<h1 style="color:#e99002;font-size:44px;">SOMETHING WENT WRONG!</h1>';
        if ( defined('_FPA_SELF_DESTRUCT_DOIT') ) {
            echo '<h2 style="color:#43ac6a;">As a security measure, FPA attempted to self-delete itself due to the time it has been present on the server, but was not successful.</h2>';
            echo '<p style="color:#e99002;font-size:20px;margin:0 auto;max-width:80%;">Please remove the file manually using FTP or through your hosting File Manager, or upload a new copy to continue using it.</p>';

        } else {
            echo '<h1 style="color:#e99002;font-size:44px;">SOMETHING WENT WRONG!</h1>';
            echo '<p style="color:#e99002;font-size:30px;">We could not delete the FPA file ('. $fpaFilename .').</p>';
            echo '<p style="color:#e99002;font-size:20px;margin:0 auto;max-width:80%;">For your website security, please remove the file <em style="color:#f04124;">'. $filename .'</em> manually using FTP or through your hosting File Manager.</p>';
        }

    } else {
        echo '<div id="deleteMessage" style="padding:20px;border:1px solid #43ac6a;background-color:#effff5;margin:0 auto;margin-top:50px;margin-bottom:20px;max-width:70%;position:relative;z-index:9999;top:10%;font-family:sans-serif, arial;" align="center">';
        if ( defined('_FPA_SELF_DESTRUCT_DOIT') ) {
            echo '<h2 style="color:#43ac6a;">As a security measure, this copy of FPA has been self-deleted due to the time it has been present on the server.</h2>';
            echo '<p style="color:#e99002;font-size:20px;margin:0 auto;max-width:80%;">You will need to upload another copy of FPA to continue.</p>';
        } else {
            echo '<h1 style="color:#43ac6a;">Thank You For Using The FPA.</h1>';
        }
    }

`

If I knew how to create a PR I would write the code. Instead, all I can do is explain in words:

  • Define (in one place) the variable $fpaFilename before line 104 (say, at line 86).
  • Delete lines 103-104
  • Change lines 106-107, replace $fpafile with $fpaFilename
  • Delete lines 514-515
  • Change line 541, replace $filename with $fpaFilename ($filename is not defined anywhere)

fpa-en and Joomla 2.5.x

fpa-en has missing Joomla instance when used on Joomla 2.5.x site.

Joomla! Instance :: .- ()

Maximum SELF_DESTRUCT_AGE limit

@sozzled
define ( '_FPA_SELF_DESTRUCT_AGE', 1 ); // age of FPA file before _FPA_SELF_DESTRUCT runs (set as CONSTANT so it can't be changed/overridden at runtime)

One day should be enough. If the file is auto deleted, the owner can put a new version there. Reducing the time wait reduces the opportunity for someone else running the FPA and (possibly) obtaining some private information.

Proposal for ALL future release naming conventions

There's been a lot of discussion over the time about naming of pre~releases etc etc...

I'd like to suggest/propose that we assigned a single person to provide "names" as we go forward (ignoring and overriding the current naming convention used in the 2020-UI-Facelift development, I just made that up to differentiate the branch from the older dev branches and have absolutely no care nor concern for it)

@mandville and your dog, would you be willing to be the lead with this? Whatever you two come up with, for whatever reason, is the name of future releases and we simply use "development" as any interim name until the dog has approved the official name.

Unless you desire, we don't have to stick to a theme or methodology, just an interesting name...

Translations - same tag name is used in two places - need different names

Not everything is translatable (hard coded) and as usual the Finnish language gives us a bit of trouble. Can't remember exactly where, but the general problem is that the same tag is used in two places where it works for English but where you'd need to use a different declension (/inflection/conjugation) or even a word in Finnish because of the context.

Will try to get example(s) to post here.

Add noindex meta tag to output

Please add

<meta name="robots" content="noindex">

to the output, it might save a few people some trouble, see .google.com search?q=inurl::+fpa-en.php

Even though most of the entries have thankfully been deleted now, Google has helpfully cached the output in some cases.

I think that the issue is that, even if people are only leaving up the fpa for a short time (so are not doing anything silly), if Google happens to crawl it during that time then the results will be indexed and cached.

content="noindex" ensures that the results are not indexed or cached.

FPA reveals too much information

Just saw FPA report in our support site. Because of people tend to share their site address:

There should be an option to hide some sensitive information from FPA as currently if posted to public forum it gives enough information to easily hack the site (in case if there are known defects).

Versioning and PR

For some reason GH will not notify me of PR.
Can we ensure all commits and PR are thoroughly tested before release and that version numbers are notified in line with forum.

PHP Warning: Invalid argument supplied for foreach() in <site-root>/fpa-en.php on line 6452

See forum topic/post at https://forum.joomla.org/viewtopic.php?f=710&t=968910&start=30#p3557078

Unable to reproduce this error on any of my test websites (using PHP 7.2). Would anyone have any ideas how this situation occurs.

As far as the FPA report is concerned, it does not seem to have caused the FPA to fail but it's possible that the report may be ambiguous. I cannot verify if this is a coding error. Because we do not have a forum category at the J! forum, I am opening the matter for discussion here. This may not be an error. I just don't know.

Line 6542 is contained within a for-loop that looks recursively at site plugins. That's the only other information I can offer at this moment.

typos

fixed typos in output but left versioning as is

Joomla 2.5.x and multilanguage fpa

The multilanguage version of fpa partially works with Joomla 2.5.x errors observed are apparently related to determining which version of Joomla is installed.

Notice: Undefined index: cmsPRODUCT in /home/degruy18/domains/thunderhilldesign.com/public_html/design17/fpa.php on line 2929



Notice: Undefined index: cmsRELEASE in /home/degruy18/domains/thunderhilldesign.com/public_html/design17/fpa.php on line 2929



Notice: Undefined index: cmsDEVLEVEL in /home/degruy18/domains/thunderhilldesign.com/public_html/design17/fpa.php on line 2929



Notice: Undefined index: cmsDEVSTATUS in /home/degruy18/domains/thunderhilldesign.com/public_html/design17/fpa.php on line 2930



Notice: Undefined index: cmsCODENAME in /home/degruy18/domains/thunderhilldesign.com/public_html/design17/fpa.php on line 2930



Notice: Undefined index: cmsRELDATE in /home/degruy18/domains/thunderhilldesign.com/public_html/design17/fpa.php on line 2930

.- ()

FPA translation

Hey @organization/Development

This is where we should discuss the FPA translations.

  • use transifex
  • see the FPA multilanguage-development directory for scripts for working with transifex etc.

Privacy Settings

ok, so to the next obviously contentious point Privacy Settings

I've just committed a new proposal;

  • new toolbar privacy buttons
    -- Privacy is OFF by default (although I always prefer a deny, before allow mentality)
    -- if suhosin is installed (hardened server/php) AND no explicit choice is made (ON or OFF) privacy is ON

  • the radios in the post options can be removed if desired, giving the users less to choose by default and the privacy option isn't used within the post output at all
    -- then a decision on, and cleanup of, what is seen (either just removed or display text changed) in the post output can be made
    -- there are still some if $showProtected statements in the post output routine, I assume that since one of the initial 3 privacy options was removed at some point and from the comments above, that they are now just legacy and don't actually do anything anymore and can be removed

  • this means there is now only a simplified 0 (OFF) or 1 (ON)

  • a new set of redaction choices can be made to be more consistent again on the GUI version

How to add new tranlation of FPA?

Hi I wont to use FPM on Polish Joomla! Forum and I have 3 questions:

  1. Whether translating the FPM isd how supported?
  2. If yes then how to add new language?
  3. I see few issues related to localised version of FPM is open. Is there any ETA to fix tis issues?
    wojsmol (Polish Joomla! Forum Moderator)

Missing Extensions Should Account for Upstream PHP Changes

  • ext/mysql was deprecated as of PHP 5.5 and removed in PHP 7.0
  • ext/mcrypt was deprecated as of PHP 7.1 and removed in PHP 7.2

When the FPA is run on PHP versions where these extensions are no longer available, the FPA should not report them as potentially missing. This can be misleading to end users or to individuals providing support on the forums as it may be suggested to someone they need to install these dead extensions.

Move important FPA version information to top

Lines 207-209 contain

define ( '_RES', 'Forum Post Assistant' );
define ( '_RES_VERSION', '1.5.5 (rhytidectomy)' );
define ( '_last_updated', '27-May-2020' );

Suggest a few things

  1. Move these (insert at) line 34
  2. Change the definition of _RES_VERSION to
    define ( '_RES_VERSION', '1.5.5' );
  3. Create new definition of _RESas
    define ( '_RES_CODENAME', 'rhytidectomy' );
  4. Modify the coding at line 3086 to display the codename if _FPA_DIAG is true
  5. Modify the coding at line 3215 similarly
  6. Ditto for line 4715

The other references to _RES_VERSION don't matter.

Need a more accurate way to determine if there is a possible ownership issue.

There is code to attempt to test for possible file/directory ownership problems. This code has never worked well or entirely properly on all servers.
Results are displayed something similar to this:

suExec No PHP suExec No Custom su Yes Ownership Probs No

The code starts at about line 1269
/** API and ownership related settings

Proposed Update/Modernisation

Hi Folks, it's been a little while, I had some time and thought FPA might be due a bit of an overhaul.

This is purely a demo/visual representation, there ate no test/routines included yet, all data/content is hard-coded dummy data.

Although this now makes FPA an "online" (needs an internet connection) application now, this demo includes Bootstrap & jQuery from CDN to improve visual layout, responsiveness and functionality.

The download package includes a few dummy J! folders for testing only and there are temporary external/includes to separate functions for testing purposes only. It is still intentioned for this version of FPA to continue t be a single file script.

I'd be interested in your thoughts and comments before progressing any further.

Proposed FPA v2.0.0 Sample
https://github.com/hotmangoDevelopment/ForumPostAssistant-v2-2018

Cheers
RussW

PHP notices

[05-Jul-2013 15:45:36 Europe/London] PHP Notice: Undefined index: showTables in E:\Work\server\www\fpa-en.php on line 3771

                    } elseif ( ( $database['dbDOCHECKS'] != _FPA_Y OR $database['dbERROR'] != _FPA_N ) AND $_POST['showTables'] == '1' ) {

Could be fixed with:

                    } elseif ( ( $database['dbDOCHECKS'] != _FPA_Y OR $database['dbERROR'] != _FPA_N ) AND @$_POST['showTables'] == '1' ) {

[05-Jul-2013 15:45:36 Europe/London] PHP Notice: Use of undefined constant _VER - assumed '_VER' in E:\Work\server\www\fpa-en.php on line 4269

                echo '<div class="mini-content-title">'. _FPA_CF .' '. _VER .'</div>';

Could be fixed with:

                echo '<div class="mini-content-title">'. _FPA_CF .' '. _FPA_VER .'</div>';

Change ordinal date format to cardinal days and abbreviated month format.

The current FPA report displays the date as an ordinal number with the full month name

fpaHeaderForum

Most style guides for writers recommend the use of cardinal numbers in date formats.

Because different localities use different date representation formats (dd/mm/yyyy, mm/dd/yy, yyyy/mm/dd, etc.) a purely numerical representation of the month should be avoided.

I suggest the date format j-M-Y at line 4722 instead

In the illustrated example above, this would display as "2-Jun-2020". Small saving in total character count; less likely to be misinterpreted by the reader.

FPA (SELF_DESTRUCT) "Expiry Notification"

With the introduction of the SELF_DESTRUCT feature, this raises the question of user confusion/surprise and additional forum questions about quite WTF happened...

In an effort to reduce this, the last commit offers an informational "Expiry Notification" under the menu navbar stating how many days are left before FPA expiry.

  • YES this works...

  • NO delete it, not necessary...

Screen Shot 2020-06-07 at 7 19 13 pm

Look for config setup info that may be commented out

When pulling values out of the configuration.php file, it ignores if a value is inside a comment. I have one file that I can update for use locally or on the production server, so I have commented out a line that reads:
Code:
// public $host = 'localhost';

This line was immediately before the line used by the system.

For this reason, I wasn't getting any of the database info, since my hosting provider uses a db running at a different url.
Once I changed the order of these lines, then fpa picked up the correct value.

It should be easy to have preg_match detect a line starting with '//', but it might require removal of all /* ... */ comments before extracting information.

Hope this might help others who want to see info that is not coming thru.

WebMuse

suggested press release

Over a decade ago, a developer launched a suite of tools to help Joomlers diagnose issues with hosting, the installation and other related items.
Part of this suite was what is now known as the forum posting assistant or FPA.
This standalone tool created by Russ Winter has become such an integral part of the joomla world that it is used as the go to item for anyone with issues on their site.
You can not only find out the state of your server, possible conflicts that cause your site issues, but The tool will run even if Joomla isn't installed properly.

Russ was then joined by Fiona Coulter, Claire Mandville and Phil DeGuy from the security forum team to develop the tool futher. with the aid of "Frostmak" coding, with "Sozzled" and Webdongle testing and suggestion the current stable release 1.5 available on Github now has full easy to documentation and has helped countless joomlers.

This month Russ worked on some of the outstanding issues and with the aid of the team are on the verge of releasing the latest (un named) version.
This version has fine tuned the following

  • Print to PDF, so you can pass the output to a 3rd party without leaving the script on your site,
  • Allow the FPA to check its the latest version.
  • FPA self destruct features auto-delete 7 days after installation.
  • Hosting Confidence Level to indicate how worthy of running joomla your server is.

If you wish to download the FPA and give it a run for its money then go to ...

Copyright

What is the copyright of this as I cant see one anywhere

Reducing the 20K character limit for pasting the FPA report on the forum

Several of us have flagged the 20K character limit as an issue. It's quite probable that this limit will not be relaxed by the forum administrator(s) (and for very good reasons) and it's therefore likely that the FPA V2 activity will have to accept that the 20K character limit will remain a constraint. Given that this issue has been identified as an important one, I think it may be useful to have a discrete discussion on ways that FPA V2 can reduce the amount of BBcode to keep the number of characters under 20K but, as far as possible, provide key information that may assist us in helping those who use the FPA.

Obviously, the [COLOR] tags contribute substantially to the amount of BBcode "text"; other BBcode markup tags (e.g. [U], [QUOTE] and [SIZE] also add to the weight). These formatting codes are visually important and I believe they should be retained.

As we've discussed elsewhere, if we can find some easy ways for gumby-newbies to selectively obtain parts of the FPA report suitable for posting, then all the better for FPA V2.

I prefer, from the "helper's perspective" to see as much information about a problem site as possible.

Although not always the cause, plugins can contribute to problems ... especially enabled plugins. What about FPA V2 offering the choice of displaying enabled plugins or all installed plugins?

Similarly, again while not necessarily the cause of problems, what about offering the choice of displaying published components vs. all components?

I think we can suggest other switcheroonies to reduce the volume of BBcode generated by the FPA on extension-bloated J! websites.

Readability

I find

A standalone PHP script to help end-users collect and subsequently post diagnostic and configuration information in to a forum post when asking for assistance to resolve problems or issues with their Joomla!® web-site.

Difficult to read. Perhaps the font colour could be black?

FPA Rewrite

Hey @organization/Development

Outline of what s to be done.

  • Name remain: FPA
  • Change Version number to 2.0.xx
  • remain able to detect any version of Joomla from 1.0.xx to current versions.
  • Basic single file structure remain for FPA, or if decision is to go to multiple files, an easy way to install and uninstall the files.
  • remove any code that was intended for other posting uses and we do not need to use such as bug report mode (intended to create a report for reporting Joomla bugs) and maybe diag mode. The modes are listed at the top around line 30. Don't know if Developer mode is needed though it may be handy.
    • enable a multi-language in FPA so users can see results in their own language
  • Use transifex for translation - I will post some info about what we currently have for transifex and integration.
  • the generated forum code should always be presented in English to the forum so that part would not be translated.This is another reason to group the code. I also think this is a very good idea to pursue.
  • Keep current output layout as it is easy to find related info.
  • Improve the BB code output to make it easier to read
  • BB code still has to fit a forum post in length
  • Add color to BB code
    • red - danger
    • orange - warning (may be bad or unable to determine)
    • green - OK
      will make easier to scan for issues
  • code is scattered about in various parts - reorganize and group all code into blocks to make easier to read and follow
  • all code used to generate the bb code (the generated forum code) should be grouped. This would include the section for optional information and selection of parameters in the drop down (Show the Forum Post Assistant) area that would be included in the forum posting.
  • clean up comments and add new where necessary for clarity
  • the FPA for some reason is no longer properly displaying the initial top pink title box which also contains the link to delete the script. The box should always be on display at the top of the page, but now it appears to only initially display and then is replaced with the other main parts of the script once the script is done running. This should not be happening.
  • Improve script delete (removal process) if it needs to be improved
  • some parts have always been suspect in the information that is returned or determined which should be fixed. I think mainly in the area of determining SUEXEC and custom SU for the server. Some servers such as Lightspeed, and Mediatemple servers do not necessarily use Apache SUEXEC modules, but rather custom ones.
  • Accurately determine third party plugins, templates, modules, components and their versions
  • Make results more colorful on the results display screen
    • red - danger
    • orange - warning (may be bad or unable to determine)
    • green - OK
  • Fix the section boxes as some don't fit properly with the results displayed within them.

FPA fails when encountering directories set to permissions of 000 which some people may do to suspicious directories to prevent access. Make the FPA take note of these 000 permission directories, listing them in the report and not fail.

Please add suggestions notes, discussion

Phil

FPA fails when it finds directories with 000 permissions.

Reported
When the FPA script is installed into a site that contains directories with permissions set to 000 the FPA script will fail to complete. Eventually the script will only display the top info (header) box of the script page. Removing the 000 permission directories or altering the directories permissions to 755 solves the issue.

Error related to issue:
[Mon Nov 26 23:21:00 2012] [error] [client 123.123.123.123] PHP Warning: readdir() expects parameter 1 to be resource, boolean given in /home/sites/mysite.co.uk/public_html/fpa-en.php on line 1484

Tested
The script does fail as described.

Needed:

option 1
gracefully make the directory search ignore directories that are set to 000 and not try to read them.

Option 2
make script not fail on 000 set directories
make script keep count of the number of 000 set directories and provide a indication in the FPA results page. The PHP environment or system environment info boxes would be a good place to indicate this. Adding this to the generated results for forum posting would also be good to do.

Windows Defender SmartScreen

Attempting to download the fpa zip (when Windows Defender SmartScreen is enabled, triggers a virus warning. Is there anything that can be done about that?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.