WordPress.org

Ready to get started?Download WordPress

Forums

WP Error Fix
[resolved] Improve your coding style (6 posts)

  1. igov
    Member
    Posted 1 year ago #

    Hey, i installed your plugin and seen strange wording like lang('Message'); ?>
    What a surprise in source code: <?= $factory->lang('Click to toggle'); ?>
    You better learn PHP.

    http://wordpress.org/extend/plugins/wp-bug-tracker/

  2. WP AAM
    Member
    Plugin Author

    Posted 1 year ago #

    Hi igov,
    Did I understand you right? You ask me to learn PHP :-D
    So I'll try to guess what you mean.

    It might be you PHP parser does not recognize the <?= which is a shortcut for <?php echo. If it is true, than I'll change it, based on PEAR Coding Standards.

    In case you are wondering what $factory->lang('...') means, I designed the code by using several patterns. One of them is Factory pattern which I'm using to handle the connection between plugin and CMS platform like WordPress. The same code can be easily adopted for Drupal, Joomla or any other system. This is kind of framework.

    Regards,
    Vasyl

  3. igov
    Member
    Posted 1 year ago #

    Funny :)
    WordPress offers nice way of localization http://codex.wordpress.org/Translating_WordPress#Localization_Technology
    Better instead of your own classes.

    <?= is disabled by default in recent versions of PHP. <?php cannot be disabled :) For best compatibility use <?php echo .... instead of <?=

    Matter of coding standards!

  4. WP AAM
    Member
    Plugin Author

    Posted 1 year ago #

    Hi igov,
    If you go deeper into "my own class" you'll find out that I'm using WordPress nice way of localization :)
    My goal was not to reinvent the wheel but create a framework which can be used for other platforms. Let say Typo3 or Drupal has different localization mechanism than WordPress. And module Factory knows how to handle that.
    The entire code is platform independent and does not have any single line of code for specific CMS. There are only two places related to WordPress - main file (manager.php) and in Factory Module - wordpress.php.

    Regarding <?= you might be right. It is already changed for next release. In any way it was my mistake to use the shortcut.

    Regards,
    Vasyl

  5. WP AAM
    Member
    Plugin Author

    Posted 1 year ago #

    Oh, and by the way, appreciate your interest in WP Bug Tracker.

  6. WP AAM
    Member
    Plugin Author

    Posted 11 months ago #

    Hi igov,
    The issue was fixed in release 1.2.

    Thanks for feedback.
    Vasyl

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.