Christian Sciberras
Forum Replies Created
-
Peter,
As of Netbeans 7.2, the issues I mentioned are reported automatically (they’re yellow marks in the right margin and warning icon on the left next to the line).
Here’s an example of hints, although in a Java file instead of PHP.
If you would like to see some more details about Netbeans, please check out this link.
Although I can’t be specific about external QA tools, I remember seeing an article detailing how they work and what they do.
Adding to my earlier message, while the above code tips are not really instrumental to running this plugin, I think they’re worth a quick look.
The bigger issue I would tackle is ensuring all those $_POST values do in fact exist.
Of course QA tools would probably help, but I think with this list you’ll pretty much cover most of it.
The coding style in general looks ok. As far as I can tell, indentation is consistent etc, unlike other plugins I’ve reviewed. Thumbs up for that. π
Peter,
Once you get past Netbeans’ general sluggishness, you get to see some of its (very useful) features.
I think sluggishness is a good trade-off for writing better code.
While I don’t want to force Netbeans on anyone, I think it is worth a try.I gave the code another look. In all of the PHP files I checked, aioseop.class.php is the one with most issues as reported through Netbeans.
The file is v1.6.15, and it has issues on the following lines:
201 – $home not used in function
217 – $title not used in function
316 – $matches is not defined, just do a$matches = null;before that line
469 – Global variable not in use (this doesn’t cost much in performance, I wouldn’t change it for the sake of remembering variable name)
474 – $has_ut is not used in function.
564 – $has_ut is not defined (I guess you need to move line 474 here?)
596 – Variable $len_end not in use.
639 – $post not in use (or did you mean to replace$GLOBALS['post']?)
1022 – $id not used.
1167..1169 – I think you meant to specifyglobal $aiosp_keywordsetc in the beginning of the function?
1251 – $description not used
1360 – $message not used
2094 – $typeswehave doesn’t seem to be usedStill not fixed, though the source locations have changed.
A simple fix would be to replace the following:
$awmp_edit = $_POST[‘aiosp_edit’];
$nonce = $_POST[‘nonce-aioseop-edit’];with this one:
$awmp_edit = isset($_POST[‘aiosp_edit’]) && $_POST[‘aiosp_edit’];
$nonce = isset($_POST[‘nonce-aioseop-edit’]) && $_POST[‘nonce-aioseop-edit’];Also, I gave a more general look to the code; while I don’t mean to criticize, there’s an excessive amount of unnecessary code, such as loading
$titleand not actually using it anywhere.
A simple way to fix these issues would be with the use of an intelligent IDE, such as Netbeans, or by making using of PHP QA (quality assurance) tools.Kind regards,
Chris.Forum: Fixing WordPress
In reply to: Deprecated Error in WP 3.2.1 DashboardIt’s not a “PHP issue”….if you people learned to read correctly, this problem is because simplepie was made to work with PHP 4. The requirements in PHP 5 has changed, and the code, while still works, should be changed to work in PHP 5.
I’ve reported this issues some time ago, but the devs insist they want PHP 4 support (even if as esmi said, WP needs PHP 5).
So in the end, it’s WP devs’ fault they’re allowing sloppy code from a 3rd-party extension to make it to their clients.
Forum: Fixing WordPress
In reply to: I see "Deprecated" error everywhere in dashboardJan, the problem is coming from simplepie. I’ve reported this but they don’t want to use a newer version of simplepie (claiming they want PHP v4 support – now get this, wordpress only works with PHP 5+!!)
Forum: Plugins
In reply to: SVN "access to … is forbidden"@dengbo The problem was that I was using a different account.
If I remember correctly, Mike simply made my account able to write to SVN.
Chris.
Forum: Plugins
In reply to: SVN "access to … is forbidden"Mark – Thanks for the reply! I’ll follow up through that email.
Forum: Plugins
In reply to: SVN "access to … is forbidden"Anyone????
Forum: Plugins
In reply to: SVN "access to … is forbidden"Can anyone confirm that s/he cannot update their plugin through SVN?