ECG compliance: How to do?How to write a custom extension?How to handle deprecated “Mysql4” classes when rewriting resource modelsHow to check if a collection has items?Magento 1: Performance optimizations to delete entitiesWhat is faster - getting raw attribute value or use collection?Find MIN & MAX value of product attribute in a large categoryHow to fix 'getFirstItem does not limit the result of collection load to one item` warning?Magento 1.9 module oddly breaking when changing resource folder from Mysql4 to ResourceHow to write a custom extension?Why are so many PHP functions disallowed in the Magento ECG Coding Standard?Magento ECG discourage $_FILES superglobalUnable to add magento-ecg/coding-standard to PHP_CodeSniffer:Magento 2: what's the status of M2 regarding PSR compliance?How could I create magento 2 code sniffs ruleset.xml or does someone have it?How to access $_FILES in magentos way?How to modify delete method using objectManagerMagento 2 : How to write a custom extension?PCI Compliance Scanning Tool For Any Version Of Magento Site

Is a vector space a subspace of itself?

Is domain driven design an anti-SQL pattern?

COUNT(*) or MAX(id) - which is faster?

Shall I use personal or official e-mail account when registering to external websites for work purpose?

Can I legally use front facing blue light in the UK?

Is it wise to hold on to stock that has plummeted and then stabilized?

A poker game description that does not feel gimmicky

What is the meaning of "of trouble" in the following sentence?

Typesetting a double Over Dot on top of a symbol

Why airport relocation isn't done gradually?

Does a dangling wire really electrocute me if I'm standing in water?

Is there any use for defining additional entity types in a SOQL FROM clause?

Re-submission of rejected manuscript without informing co-authors

Uplifted animals have parts of their "brain" in various locations of their body. Where?

When blogging recipes, how can I support both readers who want the narrative/journey and ones who want the printer-friendly recipe?

What is the command to reset a PC without deleting any files

Creating a loop after a break using Markov Chain in Tikz

Pristine Bit Checking

Is it legal to have the "// (c) 2019 John Smith" header in all files when there are hundreds of contributors?

How would photo IDs work for shapeshifters?

Email Account under attack (really) - anything I can do?

Is ipsum/ipsa/ipse a third person pronoun, or can it serve other functions?

New order #4: World

Could a US political party gain complete control over the government by removing checks & balances?



ECG compliance: How to do?


How to write a custom extension?How to handle deprecated “Mysql4” classes when rewriting resource modelsHow to check if a collection has items?Magento 1: Performance optimizations to delete entitiesWhat is faster - getting raw attribute value or use collection?Find MIN & MAX value of product attribute in a large categoryHow to fix 'getFirstItem does not limit the result of collection load to one item` warning?Magento 1.9 module oddly breaking when changing resource folder from Mysql4 to ResourceHow to write a custom extension?Why are so many PHP functions disallowed in the Magento ECG Coding Standard?Magento ECG discourage $_FILES superglobalUnable to add magento-ecg/coding-standard to PHP_CodeSniffer:Magento 2: what's the status of M2 regarding PSR compliance?How could I create magento 2 code sniffs ruleset.xml or does someone have it?How to access $_FILES in magentos way?How to modify delete method using objectManagerMagento 2 : How to write a custom extension?PCI Compliance Scanning Tool For Any Version Of Magento Site






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








10















There is something like a coding standard for Magento 1, called ECG where numerous things should be avoided or methods that should not be used.



Let's try to create a list that covers all cases that are throwing "errors" or "warning" in your code.



Below you'll find a list with all possible warnings. I'll update this post at regular intervals and link to given and upvoted answers.



Note: please try to avoid duplicate answers ;)



Download: https://github.com/magento-ecg/coding-standard




ECG Sniffs



Classes




Mysql4



Mysql4 classes are obsolete.




  • How to handle deprecated “Mysql4” classes when rewriting resource models

  • Magento 1.9 module oddly breaking when changing resource folder from Mysql4 to Resource


Object Instantiation



Direct object instantiation (class %s) is discouraged in Magento.




protected $disallowedClassPrefixes = array(
'Mage_',
'Enterprise_',
);


...



PHP




Goto



Use of goto is discouraged.




...




Namespace



Namespace for "'.$exceptionClassName.'" class is not specified.




...




Private Class Member



Private class member detected.




...




Var



Private class member detected.




...



Performance




Collection Count



Unnecessary loading of a Magento data collection. Use the getSize() method instead.




  • How to check if a collection has items?


FetchAll



fetchAll() can be memory inefficient for large data sets.




...




GetFirstItem



getFirstItem() does not limit the result of collection load to one item.




  • GetFirstItem - https://magento.stackexchange.com/a/179309/46249


Loop



Array size calculation function %s detected in loop



Model LSD method %s detected in loop



Data load %s method detected in loop




protected $countFunctions = array(
'sizeof',
'count'
);
protected $modelLsdMethods = array(
'load',
'save',
'delete'
);


  • load

    • Find MIN & MAX value of product attribute in a large category


  • ...

Security




Acl



Missing the %s() ACL method in the %s class.




const PARENT_CLASS_NAME = 'Mage_Adminhtml_Controller_Action';
const REQUIRED_ACL_METHOD_NAME = '_isAllowed';


...




Discouraged Function




public $forbiddenFunctions = array(
'^is_dir' => null,
'^is_file$' => null,
'^pathinfo$' => null,
);


...




Forbidden Function




public $forbiddenFunctions = array(
'^assert$' => null,
'^bind_textdomain_codeset$' => null,
'^bindtextdomain$' => null,
'^bz.*$' => null,
'^call_user_func$' => null,
'^call_user_func_array$' => null,
'^chdir$' => null,
'^chgrp$' => null,
'^chmod$' => null,
'^chown$' => null,
'^chroot$' => null,
'^com_load_typelib$' => null,
'^copy$' => null,
'^create_function$' => null,
'^curl_.*$' => null,
'^cyrus_connect$' => null,
'^dba_.*$' => null,
'^dbase_.*$' => null,
'^dbx_.*$' => null,
'^dcgettext$' => null,
'^dcngettext$' => null,
'^dgettext$' => null,
'^dio_.*$' => null,
'^dirname$' => null,
'^dngettext$' => null,
'^domxml_.*$' => null,
'^exec$' => null,
'^fbsql_.*$' => null,
'^fdf_add_doc_javascript$' => null,
'^fdf_open$' => null,
'^fopen$' => null,
'^fsockopen$' => null,
'^ftp_.*$' => null,
'^fwrite$' => null,
'^gettext$' => null,
'^gz.*$' => null,
'^header$' => null,
'^highlight_file$' => null,
'^ibase_.*$' => null,
'^id3_set_tag$' => null,
'^ifx_.*$' => null,
'^image.*$' => null,
'^imap_.*$' => null,
'^ingres_.*$' => null,
'^ircg_.*$' => null,
'^ldap_.*$' => null,
'^link$' => null,
'^mail$' => null,
'^mb_send_mail$' => null,
'^mkdir$' => null,
'^move_uploaded_file$' => null,
'^msession_.*$' => null,
'^msg_send$' => null,
'^msql$' => null,
'^msql_.*$' => null,
'^mssql_.*$' => null,
'^mysql_.*$' => null,
'^odbc_.*$' => null,
'^opendir$' => null,
'^openlog$' => null,
'^ora_.*$' => null,
'^ovrimos_.*$' => null,
'^parse_ini_file$' => null,
'^parse_str$' => null,
'^parse_url$' => null,
'^parsekit_compile_string$' => null,
'^passthru$' => null,
'^pcntl_.*$' => null,
'^posix_.*$' => null,
'^pfpro_.*$' => null,
'^pfsockopen$' => null,
'^pg_.*$' => null,
'^php_check_syntax$' => null,
'^popen$' => null,
'^print_r$' => null,
'^printf$' => null,
'^proc_open$' => null,
'^putenv$' => null,
'^readfile$' => null,
'^readgzfile$' => null,
'^readline$' => null,
'^readlink$' => null,
'^register_shutdown_function$' => null,
'^register_tick_function$' => null,
'^rename$' => null,
'^rmdir$' => null,
'^scandir$' => null,
'^session_.*$' => null,
'^set_include_path$' => null,
'^set_ini$' => null,
'^set_time_limit$' => null,
'^setcookie$' => null,
'^setlocale$' => null,
'^setrawcookie$' => null,
'^shell_exec$' => null,
'^sleep$' => null,
'^socket_.*$' => null,
'^stream_.*$' => null,
'^sybase_.*$' => null,
'^symlink$' => null,
'^syslog$' => null,
'^system$' => null,
'^touch$' => null,
'^trigger_error$' => null,
'^unlink$' => null,
'^vprintf$' => null,
'^mysqli.*$' => null,
'^oci_connect$' => null,
'^oci_pconnect$' => null,
'^quotemeta$' => null,
'^sqlite_popen$' => null,
'^time_nanosleep$' => null,
'^base64_decode$' => null,
'^base_convert$' => null,
'^basename$' => null,
'^chr$' => null,
'^convert_cyr_string$' => null,
'^dba_nextkey$' => null,
'^dns_get_record$' => null,
'^extract$' => null,
'^fdf_.*$' => null,
'^fget.*$' => null,
'^fread$' => null,
'^fflush$' => null,
'^get_browser$' => null,
'^get_headers$' => null,
'^get_meta_tags$' => null,
'^getallheaders$' => null,
'^getenv$' => null,
'^getopt$' => null,
'^headers_list$' => null,
'^hebrev$' => null,
'^hebrevc$' => null,
'^highlight_string$' => null,
'^html_entity_decode$' => null,
'^ibase_blob_import$' => null,
'^id3_get_tag$' => null,
'^import_request_variables$' => null,
'^ircg_nickname_unescape$' => null,
'^ldap_get_values$' => null,
'^mb_decode_mimeheader$' => null,
'^mb_parse_str$' => null,
'^mcrypt_decrypt$' => null,
'^mdecrypt_generic$' => null,
'^msg_receive$' => null,
'^ngettext$' => null,
'^ob_get_contents$' => null,
'^ob_get_flush$' => null,
'^rawurldecode$' => null,
'^shm_get_var$' => null,
'^stripcslashes$' => null,
'^stripslashes$' => null,
'^token_get_all$' => null,
'^unpack$' => null,
'^convert_uudecode$' => null,
'^iconv_mime_decode$' => null,
'^iconv_mime_decode_headers$' => null,
'^iconv_mime_encode$' => null,
'^iconv_set_encoding$' => null,
'^php_strip_whitespace$' => null,
'^addcslashes$' => null,
'^addslashes$' => null,
'^escapeshellarg$' => null,
'^escapeshellcmd$' => null,
'^gettype$' => null,
'^var_dump$' => null,
'^tempnam$' => null,
'^realpath$' => null,
'^linkinfo$' => null,
'^lstat$' => null,
'^stat$' => null,
'^lchgrp$' => null,
'^lchown$' => null,
'^show_source$' => null,
'^is_executable$' => null,
'^is_link$' => null,
'^is_readable$' => null,
'^is_writable$' => null,
'^is_writeable$' => null,
'^is_uploaded_file$' => null,
'^glob$' => null,
'^ssh2_.*$' => null,
'^delete$' => null,
'^file.*$' => null,
);


  • ...

  • curl_: - https://magento.stackexchange.com/a/178642/46249

  • file_exists - https://magento.stackexchange.com/a/178641/46249

  • ...


Include File



"%s" statement detected. File manipulations are discouraged.



... Statement is not a function, no parentheses are required.



... Passing urls is forbidden.



... Concatenating is forbidden.



... Variables inside are insecure.




public $urlPattern = '#(https?|ftp)://.*#i';


...




Language Construct



Incorrect usage of back quote string constant. Back quotes should be always inside strings.



Use of %s language construct is discouraged.




 return array(
T_EXIT,
T_ECHO,
T_PRINT,
T_BACKTICK
);


...




Superglobal



Direct use of %s Superglobal detected.




public $superGlobalErrors = array(
'$GLOBALS',
'$_GET',
'$_POST',
'$_SESSION',
'$_REQUEST',
'$_ENV'
);
public $superGlobalWarning = array(
'$_FILES',
'$_COOKIE',
'$_SERVER',
);


Sql




Raw Query



Possible raw SQL statement %s detected




public $statements = array(
'SELECT',
'UPDATE',
'INSERT',
'CREATE',
'DELETE',
'ALTER',
'DROP'
);
public $queryFunctions = array(
'query',
'raw_query'
);


...




Slow Query



Possible slow SQL statement %s detected



Possible slow SQL method %s detected




public $adapterMethods = array(
'group',
'having',
'distinct',
'addLikeEscape',
'escapeLikeValue',
'union',
'orHaving',
);
public $rawStatements = array(
'GROUP BY',
'HAVING',
'DISTINCT',
'LIKE',
'UNION',
);


...



Strings




RegEx



Possible executable regular expression in %s. Make sure that the pattern doesn't contain "e" modifier




public $functions = array(
'preg_replace',
);


...




String Concat



Use of + operator to concatenate two strings detected




...




String Position



Identical operator === is not used for testing the return value of %s function




public $functions = array(
'strpos',
'stripos',
);


  • http://php.net/manual/en/function.strpos.php#refsect1-function.strpos-examples

  • http://php.net/manual/en/function.stripos.php#refsect1-function.stripos-examples


Related questions & answers for best-practice



  • What is faster - getting raw attribute value or use collection?

  • Magento 1: Performance optimizations to delete entities









share|improve this question
























  • LOL about this post, you wrote almost a doc :)

    – PЯINCƏ
    Jul 22 '17 at 22:49











  • @Prince someone else could help a bit to complete this :P

    – sv3n
    Jul 22 '17 at 22:59











  • I don't think so :)

    – PЯINCƏ
    Jul 22 '17 at 23:04












  • any alternative for stripcslashes()? @sv3n thanks for such description question and answers :)

    – Keyur Shah
    Jan 30 '18 at 14:05











  • @KeyurShah No. Either ignore warning or try to avoid "before" :) In wich case you use it? Maybe add this as question?

    – sv3n
    Jan 30 '18 at 21:26


















10















There is something like a coding standard for Magento 1, called ECG where numerous things should be avoided or methods that should not be used.



Let's try to create a list that covers all cases that are throwing "errors" or "warning" in your code.



Below you'll find a list with all possible warnings. I'll update this post at regular intervals and link to given and upvoted answers.



Note: please try to avoid duplicate answers ;)



Download: https://github.com/magento-ecg/coding-standard




ECG Sniffs



Classes




Mysql4



Mysql4 classes are obsolete.




  • How to handle deprecated “Mysql4” classes when rewriting resource models

  • Magento 1.9 module oddly breaking when changing resource folder from Mysql4 to Resource


Object Instantiation



Direct object instantiation (class %s) is discouraged in Magento.




protected $disallowedClassPrefixes = array(
'Mage_',
'Enterprise_',
);


...



PHP




Goto



Use of goto is discouraged.




...




Namespace



Namespace for "'.$exceptionClassName.'" class is not specified.




...




Private Class Member



Private class member detected.




...




Var



Private class member detected.




...



Performance




Collection Count



Unnecessary loading of a Magento data collection. Use the getSize() method instead.




  • How to check if a collection has items?


FetchAll



fetchAll() can be memory inefficient for large data sets.




...




GetFirstItem



getFirstItem() does not limit the result of collection load to one item.




  • GetFirstItem - https://magento.stackexchange.com/a/179309/46249


Loop



Array size calculation function %s detected in loop



Model LSD method %s detected in loop



Data load %s method detected in loop




protected $countFunctions = array(
'sizeof',
'count'
);
protected $modelLsdMethods = array(
'load',
'save',
'delete'
);


  • load

    • Find MIN & MAX value of product attribute in a large category


  • ...

Security




Acl



Missing the %s() ACL method in the %s class.




const PARENT_CLASS_NAME = 'Mage_Adminhtml_Controller_Action';
const REQUIRED_ACL_METHOD_NAME = '_isAllowed';


...




Discouraged Function




public $forbiddenFunctions = array(
'^is_dir' => null,
'^is_file$' => null,
'^pathinfo$' => null,
);


...




Forbidden Function




public $forbiddenFunctions = array(
'^assert$' => null,
'^bind_textdomain_codeset$' => null,
'^bindtextdomain$' => null,
'^bz.*$' => null,
'^call_user_func$' => null,
'^call_user_func_array$' => null,
'^chdir$' => null,
'^chgrp$' => null,
'^chmod$' => null,
'^chown$' => null,
'^chroot$' => null,
'^com_load_typelib$' => null,
'^copy$' => null,
'^create_function$' => null,
'^curl_.*$' => null,
'^cyrus_connect$' => null,
'^dba_.*$' => null,
'^dbase_.*$' => null,
'^dbx_.*$' => null,
'^dcgettext$' => null,
'^dcngettext$' => null,
'^dgettext$' => null,
'^dio_.*$' => null,
'^dirname$' => null,
'^dngettext$' => null,
'^domxml_.*$' => null,
'^exec$' => null,
'^fbsql_.*$' => null,
'^fdf_add_doc_javascript$' => null,
'^fdf_open$' => null,
'^fopen$' => null,
'^fsockopen$' => null,
'^ftp_.*$' => null,
'^fwrite$' => null,
'^gettext$' => null,
'^gz.*$' => null,
'^header$' => null,
'^highlight_file$' => null,
'^ibase_.*$' => null,
'^id3_set_tag$' => null,
'^ifx_.*$' => null,
'^image.*$' => null,
'^imap_.*$' => null,
'^ingres_.*$' => null,
'^ircg_.*$' => null,
'^ldap_.*$' => null,
'^link$' => null,
'^mail$' => null,
'^mb_send_mail$' => null,
'^mkdir$' => null,
'^move_uploaded_file$' => null,
'^msession_.*$' => null,
'^msg_send$' => null,
'^msql$' => null,
'^msql_.*$' => null,
'^mssql_.*$' => null,
'^mysql_.*$' => null,
'^odbc_.*$' => null,
'^opendir$' => null,
'^openlog$' => null,
'^ora_.*$' => null,
'^ovrimos_.*$' => null,
'^parse_ini_file$' => null,
'^parse_str$' => null,
'^parse_url$' => null,
'^parsekit_compile_string$' => null,
'^passthru$' => null,
'^pcntl_.*$' => null,
'^posix_.*$' => null,
'^pfpro_.*$' => null,
'^pfsockopen$' => null,
'^pg_.*$' => null,
'^php_check_syntax$' => null,
'^popen$' => null,
'^print_r$' => null,
'^printf$' => null,
'^proc_open$' => null,
'^putenv$' => null,
'^readfile$' => null,
'^readgzfile$' => null,
'^readline$' => null,
'^readlink$' => null,
'^register_shutdown_function$' => null,
'^register_tick_function$' => null,
'^rename$' => null,
'^rmdir$' => null,
'^scandir$' => null,
'^session_.*$' => null,
'^set_include_path$' => null,
'^set_ini$' => null,
'^set_time_limit$' => null,
'^setcookie$' => null,
'^setlocale$' => null,
'^setrawcookie$' => null,
'^shell_exec$' => null,
'^sleep$' => null,
'^socket_.*$' => null,
'^stream_.*$' => null,
'^sybase_.*$' => null,
'^symlink$' => null,
'^syslog$' => null,
'^system$' => null,
'^touch$' => null,
'^trigger_error$' => null,
'^unlink$' => null,
'^vprintf$' => null,
'^mysqli.*$' => null,
'^oci_connect$' => null,
'^oci_pconnect$' => null,
'^quotemeta$' => null,
'^sqlite_popen$' => null,
'^time_nanosleep$' => null,
'^base64_decode$' => null,
'^base_convert$' => null,
'^basename$' => null,
'^chr$' => null,
'^convert_cyr_string$' => null,
'^dba_nextkey$' => null,
'^dns_get_record$' => null,
'^extract$' => null,
'^fdf_.*$' => null,
'^fget.*$' => null,
'^fread$' => null,
'^fflush$' => null,
'^get_browser$' => null,
'^get_headers$' => null,
'^get_meta_tags$' => null,
'^getallheaders$' => null,
'^getenv$' => null,
'^getopt$' => null,
'^headers_list$' => null,
'^hebrev$' => null,
'^hebrevc$' => null,
'^highlight_string$' => null,
'^html_entity_decode$' => null,
'^ibase_blob_import$' => null,
'^id3_get_tag$' => null,
'^import_request_variables$' => null,
'^ircg_nickname_unescape$' => null,
'^ldap_get_values$' => null,
'^mb_decode_mimeheader$' => null,
'^mb_parse_str$' => null,
'^mcrypt_decrypt$' => null,
'^mdecrypt_generic$' => null,
'^msg_receive$' => null,
'^ngettext$' => null,
'^ob_get_contents$' => null,
'^ob_get_flush$' => null,
'^rawurldecode$' => null,
'^shm_get_var$' => null,
'^stripcslashes$' => null,
'^stripslashes$' => null,
'^token_get_all$' => null,
'^unpack$' => null,
'^convert_uudecode$' => null,
'^iconv_mime_decode$' => null,
'^iconv_mime_decode_headers$' => null,
'^iconv_mime_encode$' => null,
'^iconv_set_encoding$' => null,
'^php_strip_whitespace$' => null,
'^addcslashes$' => null,
'^addslashes$' => null,
'^escapeshellarg$' => null,
'^escapeshellcmd$' => null,
'^gettype$' => null,
'^var_dump$' => null,
'^tempnam$' => null,
'^realpath$' => null,
'^linkinfo$' => null,
'^lstat$' => null,
'^stat$' => null,
'^lchgrp$' => null,
'^lchown$' => null,
'^show_source$' => null,
'^is_executable$' => null,
'^is_link$' => null,
'^is_readable$' => null,
'^is_writable$' => null,
'^is_writeable$' => null,
'^is_uploaded_file$' => null,
'^glob$' => null,
'^ssh2_.*$' => null,
'^delete$' => null,
'^file.*$' => null,
);


  • ...

  • curl_: - https://magento.stackexchange.com/a/178642/46249

  • file_exists - https://magento.stackexchange.com/a/178641/46249

  • ...


Include File



"%s" statement detected. File manipulations are discouraged.



... Statement is not a function, no parentheses are required.



... Passing urls is forbidden.



... Concatenating is forbidden.



... Variables inside are insecure.




public $urlPattern = '#(https?|ftp)://.*#i';


...




Language Construct



Incorrect usage of back quote string constant. Back quotes should be always inside strings.



Use of %s language construct is discouraged.




 return array(
T_EXIT,
T_ECHO,
T_PRINT,
T_BACKTICK
);


...




Superglobal



Direct use of %s Superglobal detected.




public $superGlobalErrors = array(
'$GLOBALS',
'$_GET',
'$_POST',
'$_SESSION',
'$_REQUEST',
'$_ENV'
);
public $superGlobalWarning = array(
'$_FILES',
'$_COOKIE',
'$_SERVER',
);


Sql




Raw Query



Possible raw SQL statement %s detected




public $statements = array(
'SELECT',
'UPDATE',
'INSERT',
'CREATE',
'DELETE',
'ALTER',
'DROP'
);
public $queryFunctions = array(
'query',
'raw_query'
);


...




Slow Query



Possible slow SQL statement %s detected



Possible slow SQL method %s detected




public $adapterMethods = array(
'group',
'having',
'distinct',
'addLikeEscape',
'escapeLikeValue',
'union',
'orHaving',
);
public $rawStatements = array(
'GROUP BY',
'HAVING',
'DISTINCT',
'LIKE',
'UNION',
);


...



Strings




RegEx



Possible executable regular expression in %s. Make sure that the pattern doesn't contain "e" modifier




public $functions = array(
'preg_replace',
);


...




String Concat



Use of + operator to concatenate two strings detected




...




String Position



Identical operator === is not used for testing the return value of %s function




public $functions = array(
'strpos',
'stripos',
);


  • http://php.net/manual/en/function.strpos.php#refsect1-function.strpos-examples

  • http://php.net/manual/en/function.stripos.php#refsect1-function.stripos-examples


Related questions & answers for best-practice



  • What is faster - getting raw attribute value or use collection?

  • Magento 1: Performance optimizations to delete entities









share|improve this question
























  • LOL about this post, you wrote almost a doc :)

    – PЯINCƏ
    Jul 22 '17 at 22:49











  • @Prince someone else could help a bit to complete this :P

    – sv3n
    Jul 22 '17 at 22:59











  • I don't think so :)

    – PЯINCƏ
    Jul 22 '17 at 23:04












  • any alternative for stripcslashes()? @sv3n thanks for such description question and answers :)

    – Keyur Shah
    Jan 30 '18 at 14:05











  • @KeyurShah No. Either ignore warning or try to avoid "before" :) In wich case you use it? Maybe add this as question?

    – sv3n
    Jan 30 '18 at 21:26














10












10








10


1






There is something like a coding standard for Magento 1, called ECG where numerous things should be avoided or methods that should not be used.



Let's try to create a list that covers all cases that are throwing "errors" or "warning" in your code.



Below you'll find a list with all possible warnings. I'll update this post at regular intervals and link to given and upvoted answers.



Note: please try to avoid duplicate answers ;)



Download: https://github.com/magento-ecg/coding-standard




ECG Sniffs



Classes




Mysql4



Mysql4 classes are obsolete.




  • How to handle deprecated “Mysql4” classes when rewriting resource models

  • Magento 1.9 module oddly breaking when changing resource folder from Mysql4 to Resource


Object Instantiation



Direct object instantiation (class %s) is discouraged in Magento.




protected $disallowedClassPrefixes = array(
'Mage_',
'Enterprise_',
);


...



PHP




Goto



Use of goto is discouraged.




...




Namespace



Namespace for "'.$exceptionClassName.'" class is not specified.




...




Private Class Member



Private class member detected.




...




Var



Private class member detected.




...



Performance




Collection Count



Unnecessary loading of a Magento data collection. Use the getSize() method instead.




  • How to check if a collection has items?


FetchAll



fetchAll() can be memory inefficient for large data sets.




...




GetFirstItem



getFirstItem() does not limit the result of collection load to one item.




  • GetFirstItem - https://magento.stackexchange.com/a/179309/46249


Loop



Array size calculation function %s detected in loop



Model LSD method %s detected in loop



Data load %s method detected in loop




protected $countFunctions = array(
'sizeof',
'count'
);
protected $modelLsdMethods = array(
'load',
'save',
'delete'
);


  • load

    • Find MIN & MAX value of product attribute in a large category


  • ...

Security




Acl



Missing the %s() ACL method in the %s class.




const PARENT_CLASS_NAME = 'Mage_Adminhtml_Controller_Action';
const REQUIRED_ACL_METHOD_NAME = '_isAllowed';


...




Discouraged Function




public $forbiddenFunctions = array(
'^is_dir' => null,
'^is_file$' => null,
'^pathinfo$' => null,
);


...




Forbidden Function




public $forbiddenFunctions = array(
'^assert$' => null,
'^bind_textdomain_codeset$' => null,
'^bindtextdomain$' => null,
'^bz.*$' => null,
'^call_user_func$' => null,
'^call_user_func_array$' => null,
'^chdir$' => null,
'^chgrp$' => null,
'^chmod$' => null,
'^chown$' => null,
'^chroot$' => null,
'^com_load_typelib$' => null,
'^copy$' => null,
'^create_function$' => null,
'^curl_.*$' => null,
'^cyrus_connect$' => null,
'^dba_.*$' => null,
'^dbase_.*$' => null,
'^dbx_.*$' => null,
'^dcgettext$' => null,
'^dcngettext$' => null,
'^dgettext$' => null,
'^dio_.*$' => null,
'^dirname$' => null,
'^dngettext$' => null,
'^domxml_.*$' => null,
'^exec$' => null,
'^fbsql_.*$' => null,
'^fdf_add_doc_javascript$' => null,
'^fdf_open$' => null,
'^fopen$' => null,
'^fsockopen$' => null,
'^ftp_.*$' => null,
'^fwrite$' => null,
'^gettext$' => null,
'^gz.*$' => null,
'^header$' => null,
'^highlight_file$' => null,
'^ibase_.*$' => null,
'^id3_set_tag$' => null,
'^ifx_.*$' => null,
'^image.*$' => null,
'^imap_.*$' => null,
'^ingres_.*$' => null,
'^ircg_.*$' => null,
'^ldap_.*$' => null,
'^link$' => null,
'^mail$' => null,
'^mb_send_mail$' => null,
'^mkdir$' => null,
'^move_uploaded_file$' => null,
'^msession_.*$' => null,
'^msg_send$' => null,
'^msql$' => null,
'^msql_.*$' => null,
'^mssql_.*$' => null,
'^mysql_.*$' => null,
'^odbc_.*$' => null,
'^opendir$' => null,
'^openlog$' => null,
'^ora_.*$' => null,
'^ovrimos_.*$' => null,
'^parse_ini_file$' => null,
'^parse_str$' => null,
'^parse_url$' => null,
'^parsekit_compile_string$' => null,
'^passthru$' => null,
'^pcntl_.*$' => null,
'^posix_.*$' => null,
'^pfpro_.*$' => null,
'^pfsockopen$' => null,
'^pg_.*$' => null,
'^php_check_syntax$' => null,
'^popen$' => null,
'^print_r$' => null,
'^printf$' => null,
'^proc_open$' => null,
'^putenv$' => null,
'^readfile$' => null,
'^readgzfile$' => null,
'^readline$' => null,
'^readlink$' => null,
'^register_shutdown_function$' => null,
'^register_tick_function$' => null,
'^rename$' => null,
'^rmdir$' => null,
'^scandir$' => null,
'^session_.*$' => null,
'^set_include_path$' => null,
'^set_ini$' => null,
'^set_time_limit$' => null,
'^setcookie$' => null,
'^setlocale$' => null,
'^setrawcookie$' => null,
'^shell_exec$' => null,
'^sleep$' => null,
'^socket_.*$' => null,
'^stream_.*$' => null,
'^sybase_.*$' => null,
'^symlink$' => null,
'^syslog$' => null,
'^system$' => null,
'^touch$' => null,
'^trigger_error$' => null,
'^unlink$' => null,
'^vprintf$' => null,
'^mysqli.*$' => null,
'^oci_connect$' => null,
'^oci_pconnect$' => null,
'^quotemeta$' => null,
'^sqlite_popen$' => null,
'^time_nanosleep$' => null,
'^base64_decode$' => null,
'^base_convert$' => null,
'^basename$' => null,
'^chr$' => null,
'^convert_cyr_string$' => null,
'^dba_nextkey$' => null,
'^dns_get_record$' => null,
'^extract$' => null,
'^fdf_.*$' => null,
'^fget.*$' => null,
'^fread$' => null,
'^fflush$' => null,
'^get_browser$' => null,
'^get_headers$' => null,
'^get_meta_tags$' => null,
'^getallheaders$' => null,
'^getenv$' => null,
'^getopt$' => null,
'^headers_list$' => null,
'^hebrev$' => null,
'^hebrevc$' => null,
'^highlight_string$' => null,
'^html_entity_decode$' => null,
'^ibase_blob_import$' => null,
'^id3_get_tag$' => null,
'^import_request_variables$' => null,
'^ircg_nickname_unescape$' => null,
'^ldap_get_values$' => null,
'^mb_decode_mimeheader$' => null,
'^mb_parse_str$' => null,
'^mcrypt_decrypt$' => null,
'^mdecrypt_generic$' => null,
'^msg_receive$' => null,
'^ngettext$' => null,
'^ob_get_contents$' => null,
'^ob_get_flush$' => null,
'^rawurldecode$' => null,
'^shm_get_var$' => null,
'^stripcslashes$' => null,
'^stripslashes$' => null,
'^token_get_all$' => null,
'^unpack$' => null,
'^convert_uudecode$' => null,
'^iconv_mime_decode$' => null,
'^iconv_mime_decode_headers$' => null,
'^iconv_mime_encode$' => null,
'^iconv_set_encoding$' => null,
'^php_strip_whitespace$' => null,
'^addcslashes$' => null,
'^addslashes$' => null,
'^escapeshellarg$' => null,
'^escapeshellcmd$' => null,
'^gettype$' => null,
'^var_dump$' => null,
'^tempnam$' => null,
'^realpath$' => null,
'^linkinfo$' => null,
'^lstat$' => null,
'^stat$' => null,
'^lchgrp$' => null,
'^lchown$' => null,
'^show_source$' => null,
'^is_executable$' => null,
'^is_link$' => null,
'^is_readable$' => null,
'^is_writable$' => null,
'^is_writeable$' => null,
'^is_uploaded_file$' => null,
'^glob$' => null,
'^ssh2_.*$' => null,
'^delete$' => null,
'^file.*$' => null,
);


  • ...

  • curl_: - https://magento.stackexchange.com/a/178642/46249

  • file_exists - https://magento.stackexchange.com/a/178641/46249

  • ...


Include File



"%s" statement detected. File manipulations are discouraged.



... Statement is not a function, no parentheses are required.



... Passing urls is forbidden.



... Concatenating is forbidden.



... Variables inside are insecure.




public $urlPattern = '#(https?|ftp)://.*#i';


...




Language Construct



Incorrect usage of back quote string constant. Back quotes should be always inside strings.



Use of %s language construct is discouraged.




 return array(
T_EXIT,
T_ECHO,
T_PRINT,
T_BACKTICK
);


...




Superglobal



Direct use of %s Superglobal detected.




public $superGlobalErrors = array(
'$GLOBALS',
'$_GET',
'$_POST',
'$_SESSION',
'$_REQUEST',
'$_ENV'
);
public $superGlobalWarning = array(
'$_FILES',
'$_COOKIE',
'$_SERVER',
);


Sql




Raw Query



Possible raw SQL statement %s detected




public $statements = array(
'SELECT',
'UPDATE',
'INSERT',
'CREATE',
'DELETE',
'ALTER',
'DROP'
);
public $queryFunctions = array(
'query',
'raw_query'
);


...




Slow Query



Possible slow SQL statement %s detected



Possible slow SQL method %s detected




public $adapterMethods = array(
'group',
'having',
'distinct',
'addLikeEscape',
'escapeLikeValue',
'union',
'orHaving',
);
public $rawStatements = array(
'GROUP BY',
'HAVING',
'DISTINCT',
'LIKE',
'UNION',
);


...



Strings




RegEx



Possible executable regular expression in %s. Make sure that the pattern doesn't contain "e" modifier




public $functions = array(
'preg_replace',
);


...




String Concat



Use of + operator to concatenate two strings detected




...




String Position



Identical operator === is not used for testing the return value of %s function




public $functions = array(
'strpos',
'stripos',
);


  • http://php.net/manual/en/function.strpos.php#refsect1-function.strpos-examples

  • http://php.net/manual/en/function.stripos.php#refsect1-function.stripos-examples


Related questions & answers for best-practice



  • What is faster - getting raw attribute value or use collection?

  • Magento 1: Performance optimizations to delete entities









share|improve this question
















There is something like a coding standard for Magento 1, called ECG where numerous things should be avoided or methods that should not be used.



Let's try to create a list that covers all cases that are throwing "errors" or "warning" in your code.



Below you'll find a list with all possible warnings. I'll update this post at regular intervals and link to given and upvoted answers.



Note: please try to avoid duplicate answers ;)



Download: https://github.com/magento-ecg/coding-standard




ECG Sniffs



Classes




Mysql4



Mysql4 classes are obsolete.




  • How to handle deprecated “Mysql4” classes when rewriting resource models

  • Magento 1.9 module oddly breaking when changing resource folder from Mysql4 to Resource


Object Instantiation



Direct object instantiation (class %s) is discouraged in Magento.




protected $disallowedClassPrefixes = array(
'Mage_',
'Enterprise_',
);


...



PHP




Goto



Use of goto is discouraged.




...




Namespace



Namespace for "'.$exceptionClassName.'" class is not specified.




...




Private Class Member



Private class member detected.




...




Var



Private class member detected.




...



Performance




Collection Count



Unnecessary loading of a Magento data collection. Use the getSize() method instead.




  • How to check if a collection has items?


FetchAll



fetchAll() can be memory inefficient for large data sets.




...




GetFirstItem



getFirstItem() does not limit the result of collection load to one item.




  • GetFirstItem - https://magento.stackexchange.com/a/179309/46249


Loop



Array size calculation function %s detected in loop



Model LSD method %s detected in loop



Data load %s method detected in loop




protected $countFunctions = array(
'sizeof',
'count'
);
protected $modelLsdMethods = array(
'load',
'save',
'delete'
);


  • load

    • Find MIN & MAX value of product attribute in a large category


  • ...

Security




Acl



Missing the %s() ACL method in the %s class.




const PARENT_CLASS_NAME = 'Mage_Adminhtml_Controller_Action';
const REQUIRED_ACL_METHOD_NAME = '_isAllowed';


...




Discouraged Function




public $forbiddenFunctions = array(
'^is_dir' => null,
'^is_file$' => null,
'^pathinfo$' => null,
);


...




Forbidden Function




public $forbiddenFunctions = array(
'^assert$' => null,
'^bind_textdomain_codeset$' => null,
'^bindtextdomain$' => null,
'^bz.*$' => null,
'^call_user_func$' => null,
'^call_user_func_array$' => null,
'^chdir$' => null,
'^chgrp$' => null,
'^chmod$' => null,
'^chown$' => null,
'^chroot$' => null,
'^com_load_typelib$' => null,
'^copy$' => null,
'^create_function$' => null,
'^curl_.*$' => null,
'^cyrus_connect$' => null,
'^dba_.*$' => null,
'^dbase_.*$' => null,
'^dbx_.*$' => null,
'^dcgettext$' => null,
'^dcngettext$' => null,
'^dgettext$' => null,
'^dio_.*$' => null,
'^dirname$' => null,
'^dngettext$' => null,
'^domxml_.*$' => null,
'^exec$' => null,
'^fbsql_.*$' => null,
'^fdf_add_doc_javascript$' => null,
'^fdf_open$' => null,
'^fopen$' => null,
'^fsockopen$' => null,
'^ftp_.*$' => null,
'^fwrite$' => null,
'^gettext$' => null,
'^gz.*$' => null,
'^header$' => null,
'^highlight_file$' => null,
'^ibase_.*$' => null,
'^id3_set_tag$' => null,
'^ifx_.*$' => null,
'^image.*$' => null,
'^imap_.*$' => null,
'^ingres_.*$' => null,
'^ircg_.*$' => null,
'^ldap_.*$' => null,
'^link$' => null,
'^mail$' => null,
'^mb_send_mail$' => null,
'^mkdir$' => null,
'^move_uploaded_file$' => null,
'^msession_.*$' => null,
'^msg_send$' => null,
'^msql$' => null,
'^msql_.*$' => null,
'^mssql_.*$' => null,
'^mysql_.*$' => null,
'^odbc_.*$' => null,
'^opendir$' => null,
'^openlog$' => null,
'^ora_.*$' => null,
'^ovrimos_.*$' => null,
'^parse_ini_file$' => null,
'^parse_str$' => null,
'^parse_url$' => null,
'^parsekit_compile_string$' => null,
'^passthru$' => null,
'^pcntl_.*$' => null,
'^posix_.*$' => null,
'^pfpro_.*$' => null,
'^pfsockopen$' => null,
'^pg_.*$' => null,
'^php_check_syntax$' => null,
'^popen$' => null,
'^print_r$' => null,
'^printf$' => null,
'^proc_open$' => null,
'^putenv$' => null,
'^readfile$' => null,
'^readgzfile$' => null,
'^readline$' => null,
'^readlink$' => null,
'^register_shutdown_function$' => null,
'^register_tick_function$' => null,
'^rename$' => null,
'^rmdir$' => null,
'^scandir$' => null,
'^session_.*$' => null,
'^set_include_path$' => null,
'^set_ini$' => null,
'^set_time_limit$' => null,
'^setcookie$' => null,
'^setlocale$' => null,
'^setrawcookie$' => null,
'^shell_exec$' => null,
'^sleep$' => null,
'^socket_.*$' => null,
'^stream_.*$' => null,
'^sybase_.*$' => null,
'^symlink$' => null,
'^syslog$' => null,
'^system$' => null,
'^touch$' => null,
'^trigger_error$' => null,
'^unlink$' => null,
'^vprintf$' => null,
'^mysqli.*$' => null,
'^oci_connect$' => null,
'^oci_pconnect$' => null,
'^quotemeta$' => null,
'^sqlite_popen$' => null,
'^time_nanosleep$' => null,
'^base64_decode$' => null,
'^base_convert$' => null,
'^basename$' => null,
'^chr$' => null,
'^convert_cyr_string$' => null,
'^dba_nextkey$' => null,
'^dns_get_record$' => null,
'^extract$' => null,
'^fdf_.*$' => null,
'^fget.*$' => null,
'^fread$' => null,
'^fflush$' => null,
'^get_browser$' => null,
'^get_headers$' => null,
'^get_meta_tags$' => null,
'^getallheaders$' => null,
'^getenv$' => null,
'^getopt$' => null,
'^headers_list$' => null,
'^hebrev$' => null,
'^hebrevc$' => null,
'^highlight_string$' => null,
'^html_entity_decode$' => null,
'^ibase_blob_import$' => null,
'^id3_get_tag$' => null,
'^import_request_variables$' => null,
'^ircg_nickname_unescape$' => null,
'^ldap_get_values$' => null,
'^mb_decode_mimeheader$' => null,
'^mb_parse_str$' => null,
'^mcrypt_decrypt$' => null,
'^mdecrypt_generic$' => null,
'^msg_receive$' => null,
'^ngettext$' => null,
'^ob_get_contents$' => null,
'^ob_get_flush$' => null,
'^rawurldecode$' => null,
'^shm_get_var$' => null,
'^stripcslashes$' => null,
'^stripslashes$' => null,
'^token_get_all$' => null,
'^unpack$' => null,
'^convert_uudecode$' => null,
'^iconv_mime_decode$' => null,
'^iconv_mime_decode_headers$' => null,
'^iconv_mime_encode$' => null,
'^iconv_set_encoding$' => null,
'^php_strip_whitespace$' => null,
'^addcslashes$' => null,
'^addslashes$' => null,
'^escapeshellarg$' => null,
'^escapeshellcmd$' => null,
'^gettype$' => null,
'^var_dump$' => null,
'^tempnam$' => null,
'^realpath$' => null,
'^linkinfo$' => null,
'^lstat$' => null,
'^stat$' => null,
'^lchgrp$' => null,
'^lchown$' => null,
'^show_source$' => null,
'^is_executable$' => null,
'^is_link$' => null,
'^is_readable$' => null,
'^is_writable$' => null,
'^is_writeable$' => null,
'^is_uploaded_file$' => null,
'^glob$' => null,
'^ssh2_.*$' => null,
'^delete$' => null,
'^file.*$' => null,
);


  • ...

  • curl_: - https://magento.stackexchange.com/a/178642/46249

  • file_exists - https://magento.stackexchange.com/a/178641/46249

  • ...


Include File



"%s" statement detected. File manipulations are discouraged.



... Statement is not a function, no parentheses are required.



... Passing urls is forbidden.



... Concatenating is forbidden.



... Variables inside are insecure.




public $urlPattern = '#(https?|ftp)://.*#i';


...




Language Construct



Incorrect usage of back quote string constant. Back quotes should be always inside strings.



Use of %s language construct is discouraged.




 return array(
T_EXIT,
T_ECHO,
T_PRINT,
T_BACKTICK
);


...




Superglobal



Direct use of %s Superglobal detected.




public $superGlobalErrors = array(
'$GLOBALS',
'$_GET',
'$_POST',
'$_SESSION',
'$_REQUEST',
'$_ENV'
);
public $superGlobalWarning = array(
'$_FILES',
'$_COOKIE',
'$_SERVER',
);


Sql




Raw Query



Possible raw SQL statement %s detected




public $statements = array(
'SELECT',
'UPDATE',
'INSERT',
'CREATE',
'DELETE',
'ALTER',
'DROP'
);
public $queryFunctions = array(
'query',
'raw_query'
);


...




Slow Query



Possible slow SQL statement %s detected



Possible slow SQL method %s detected




public $adapterMethods = array(
'group',
'having',
'distinct',
'addLikeEscape',
'escapeLikeValue',
'union',
'orHaving',
);
public $rawStatements = array(
'GROUP BY',
'HAVING',
'DISTINCT',
'LIKE',
'UNION',
);


...



Strings




RegEx



Possible executable regular expression in %s. Make sure that the pattern doesn't contain "e" modifier




public $functions = array(
'preg_replace',
);


...




String Concat



Use of + operator to concatenate two strings detected




...




String Position



Identical operator === is not used for testing the return value of %s function




public $functions = array(
'strpos',
'stripos',
);


  • http://php.net/manual/en/function.strpos.php#refsect1-function.strpos-examples

  • http://php.net/manual/en/function.stripos.php#refsect1-function.stripos-examples


Related questions & answers for best-practice



  • What is faster - getting raw attribute value or use collection?

  • Magento 1: Performance optimizations to delete entities






magento-1 best-practice coding-standards magento-ecg






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 25 '17 at 1:39







sv3n

















asked Jun 12 '17 at 17:01









sv3nsv3n

9,93662456




9,93662456












  • LOL about this post, you wrote almost a doc :)

    – PЯINCƏ
    Jul 22 '17 at 22:49











  • @Prince someone else could help a bit to complete this :P

    – sv3n
    Jul 22 '17 at 22:59











  • I don't think so :)

    – PЯINCƏ
    Jul 22 '17 at 23:04












  • any alternative for stripcslashes()? @sv3n thanks for such description question and answers :)

    – Keyur Shah
    Jan 30 '18 at 14:05











  • @KeyurShah No. Either ignore warning or try to avoid "before" :) In wich case you use it? Maybe add this as question?

    – sv3n
    Jan 30 '18 at 21:26


















  • LOL about this post, you wrote almost a doc :)

    – PЯINCƏ
    Jul 22 '17 at 22:49











  • @Prince someone else could help a bit to complete this :P

    – sv3n
    Jul 22 '17 at 22:59











  • I don't think so :)

    – PЯINCƏ
    Jul 22 '17 at 23:04












  • any alternative for stripcslashes()? @sv3n thanks for such description question and answers :)

    – Keyur Shah
    Jan 30 '18 at 14:05











  • @KeyurShah No. Either ignore warning or try to avoid "before" :) In wich case you use it? Maybe add this as question?

    – sv3n
    Jan 30 '18 at 21:26

















LOL about this post, you wrote almost a doc :)

– PЯINCƏ
Jul 22 '17 at 22:49





LOL about this post, you wrote almost a doc :)

– PЯINCƏ
Jul 22 '17 at 22:49













@Prince someone else could help a bit to complete this :P

– sv3n
Jul 22 '17 at 22:59





@Prince someone else could help a bit to complete this :P

– sv3n
Jul 22 '17 at 22:59













I don't think so :)

– PЯINCƏ
Jul 22 '17 at 23:04






I don't think so :)

– PЯINCƏ
Jul 22 '17 at 23:04














any alternative for stripcslashes()? @sv3n thanks for such description question and answers :)

– Keyur Shah
Jan 30 '18 at 14:05





any alternative for stripcslashes()? @sv3n thanks for such description question and answers :)

– Keyur Shah
Jan 30 '18 at 14:05













@KeyurShah No. Either ignore warning or try to avoid "before" :) In wich case you use it? Maybe add this as question?

– sv3n
Jan 30 '18 at 21:26






@KeyurShah No. Either ignore warning or try to avoid "before" :) In wich case you use it? Maybe add this as question?

– sv3n
Jan 30 '18 at 21:26











3 Answers
3






active

oldest

votes


















6














Forbidden Function



file_exists()



The use of function file_exists() is forbidden



incorrect:



if (!file_exists($filePath)) 
...



correct:



$io = new Varien_Io_File();
if (!$io->fileExists($filePath))
...



or



$validatorNot = new Zend_Validate_File_NotExists($path);
if ($validatorNot->isValid($file))
...






share|improve this answer
































    5














    GetFirstItem



    getFirstItem() does not limit the result of collection load to one item.



    incorrect:



    $collection = Mage::getModel('catalog/category')
    ->load(41)
    ->getProductCollection()
    ->addAttributeToSelect('weight');

    $product = $collection->getFirstItem();
    $weight = $product->getData('weight');


    correct:



    Apply limit before grab data.



    $collection->getSelect()->limit(1)


    or



    $collection->setPageSize(1, 1)



    Expamples:



    Collection with 750 products ...



    Without limiting before:



    • Total Incl. Wall Time (microsec): 2,116,522 microsecs

    • Total Incl. CPU (microsecs): 2,101,688 microsecs

    • Total Incl. MemUse (bytes): 4,783,504 bytes

    • Total Incl. PeakMemUse (bytes): 4,363,112 bytes

    • Number of Function Calls: 104,187

    With using getSelect()->limit(1):



    • Total Incl. Wall Time (microsec): 149,803 microsecs

    • Total Incl. CPU (microsecs): 131,405 microsecs

    • Total Incl. MemUse (bytes): 2,384,840 bytes

    • Total Incl. PeakMemUse (bytes): 1,827,112 bytes

    • Number of Function Calls: 5,327

    With using setPageSize(1, 1)



    • Total Incl. Wall Time (microsec): 155,025 microsecs

    • Total Incl. CPU (microsecs): 136,191 microsecs

    • Total Incl. MemUse (bytes): 2,413,128 bytes

    • Total Incl. PeakMemUse (bytes): 1,856,064 bytes

    • Number of Function Calls: 5,515

    Note:



    This warning will still pop up, even if you limit your collection before. To get rid of this message use $collection->getLastItem() instead.






    share|improve this answer

























    • I am getting Data access method LIMIT detected outside of Resource Model when using limit`

      – Amit Patel
      Dec 12 '17 at 8:10






    • 1





      Here is more details

      – Amit Patel
      Dec 12 '17 at 10:35


















    5














    Forbidden Function



    curl_xyz



    The use of function curl_init(), curl_setopt(), curl_exec(), curl_close() is forbidden



    incorrect:



    $ch = curl_init();
    curl_setopt($connection, CURLOPT_HTTPHEADER, $header);
    curl_setopt($connection, CURLOPT_POSTFIELDS, $request);
    curl_setopt($connection, CURLOPT_URL, $url);
    $response = curl_exec($ch);
    curl_close($ch);


    correct:



    $options = array(
    CURLOPT_HTTPHEADER => $header,
    CURLOPT_POSTFIELDS => $request
    );

    $curl = new Varien_Http_Adapter_Curl();
    $curl->setOptions($options);
    $curl->write(Zend_Http_Client::GET, $url, Zend_Http_Client::HTTP_0);
    $response = $curl->read();
    $responseBody = Zend_Http_Response::extractBody($response);
    $curl->close();





    share|improve this answer

























    • I used above code and it is giving me error Uncaught Error: Class 'CustomRmaHelperVarien_Http_Adapter_Curl' not found. How to use the class i found it in vendor but no luck.

      – Nitin Pawar
      Mar 5 '18 at 8:59












    • @NitinPawar can you please open a new question? Something seems to be wrong with your code.

      – sv3n
      Mar 5 '18 at 9:01











    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "479"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f178640%2fecg-compliance-how-to-do%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    6














    Forbidden Function



    file_exists()



    The use of function file_exists() is forbidden



    incorrect:



    if (!file_exists($filePath)) 
    ...



    correct:



    $io = new Varien_Io_File();
    if (!$io->fileExists($filePath))
    ...



    or



    $validatorNot = new Zend_Validate_File_NotExists($path);
    if ($validatorNot->isValid($file))
    ...






    share|improve this answer





























      6














      Forbidden Function



      file_exists()



      The use of function file_exists() is forbidden



      incorrect:



      if (!file_exists($filePath)) 
      ...



      correct:



      $io = new Varien_Io_File();
      if (!$io->fileExists($filePath))
      ...



      or



      $validatorNot = new Zend_Validate_File_NotExists($path);
      if ($validatorNot->isValid($file))
      ...






      share|improve this answer



























        6












        6








        6







        Forbidden Function



        file_exists()



        The use of function file_exists() is forbidden



        incorrect:



        if (!file_exists($filePath)) 
        ...



        correct:



        $io = new Varien_Io_File();
        if (!$io->fileExists($filePath))
        ...



        or



        $validatorNot = new Zend_Validate_File_NotExists($path);
        if ($validatorNot->isValid($file))
        ...






        share|improve this answer















        Forbidden Function



        file_exists()



        The use of function file_exists() is forbidden



        incorrect:



        if (!file_exists($filePath)) 
        ...



        correct:



        $io = new Varien_Io_File();
        if (!$io->fileExists($filePath))
        ...



        or



        $validatorNot = new Zend_Validate_File_NotExists($path);
        if ($validatorNot->isValid($file))
        ...







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jun 16 '17 at 0:07


























        community wiki





        2 revs
        sv3n
























            5














            GetFirstItem



            getFirstItem() does not limit the result of collection load to one item.



            incorrect:



            $collection = Mage::getModel('catalog/category')
            ->load(41)
            ->getProductCollection()
            ->addAttributeToSelect('weight');

            $product = $collection->getFirstItem();
            $weight = $product->getData('weight');


            correct:



            Apply limit before grab data.



            $collection->getSelect()->limit(1)


            or



            $collection->setPageSize(1, 1)



            Expamples:



            Collection with 750 products ...



            Without limiting before:



            • Total Incl. Wall Time (microsec): 2,116,522 microsecs

            • Total Incl. CPU (microsecs): 2,101,688 microsecs

            • Total Incl. MemUse (bytes): 4,783,504 bytes

            • Total Incl. PeakMemUse (bytes): 4,363,112 bytes

            • Number of Function Calls: 104,187

            With using getSelect()->limit(1):



            • Total Incl. Wall Time (microsec): 149,803 microsecs

            • Total Incl. CPU (microsecs): 131,405 microsecs

            • Total Incl. MemUse (bytes): 2,384,840 bytes

            • Total Incl. PeakMemUse (bytes): 1,827,112 bytes

            • Number of Function Calls: 5,327

            With using setPageSize(1, 1)



            • Total Incl. Wall Time (microsec): 155,025 microsecs

            • Total Incl. CPU (microsecs): 136,191 microsecs

            • Total Incl. MemUse (bytes): 2,413,128 bytes

            • Total Incl. PeakMemUse (bytes): 1,856,064 bytes

            • Number of Function Calls: 5,515

            Note:



            This warning will still pop up, even if you limit your collection before. To get rid of this message use $collection->getLastItem() instead.






            share|improve this answer

























            • I am getting Data access method LIMIT detected outside of Resource Model when using limit`

              – Amit Patel
              Dec 12 '17 at 8:10






            • 1





              Here is more details

              – Amit Patel
              Dec 12 '17 at 10:35















            5














            GetFirstItem



            getFirstItem() does not limit the result of collection load to one item.



            incorrect:



            $collection = Mage::getModel('catalog/category')
            ->load(41)
            ->getProductCollection()
            ->addAttributeToSelect('weight');

            $product = $collection->getFirstItem();
            $weight = $product->getData('weight');


            correct:



            Apply limit before grab data.



            $collection->getSelect()->limit(1)


            or



            $collection->setPageSize(1, 1)



            Expamples:



            Collection with 750 products ...



            Without limiting before:



            • Total Incl. Wall Time (microsec): 2,116,522 microsecs

            • Total Incl. CPU (microsecs): 2,101,688 microsecs

            • Total Incl. MemUse (bytes): 4,783,504 bytes

            • Total Incl. PeakMemUse (bytes): 4,363,112 bytes

            • Number of Function Calls: 104,187

            With using getSelect()->limit(1):



            • Total Incl. Wall Time (microsec): 149,803 microsecs

            • Total Incl. CPU (microsecs): 131,405 microsecs

            • Total Incl. MemUse (bytes): 2,384,840 bytes

            • Total Incl. PeakMemUse (bytes): 1,827,112 bytes

            • Number of Function Calls: 5,327

            With using setPageSize(1, 1)



            • Total Incl. Wall Time (microsec): 155,025 microsecs

            • Total Incl. CPU (microsecs): 136,191 microsecs

            • Total Incl. MemUse (bytes): 2,413,128 bytes

            • Total Incl. PeakMemUse (bytes): 1,856,064 bytes

            • Number of Function Calls: 5,515

            Note:



            This warning will still pop up, even if you limit your collection before. To get rid of this message use $collection->getLastItem() instead.






            share|improve this answer

























            • I am getting Data access method LIMIT detected outside of Resource Model when using limit`

              – Amit Patel
              Dec 12 '17 at 8:10






            • 1





              Here is more details

              – Amit Patel
              Dec 12 '17 at 10:35













            5












            5








            5







            GetFirstItem



            getFirstItem() does not limit the result of collection load to one item.



            incorrect:



            $collection = Mage::getModel('catalog/category')
            ->load(41)
            ->getProductCollection()
            ->addAttributeToSelect('weight');

            $product = $collection->getFirstItem();
            $weight = $product->getData('weight');


            correct:



            Apply limit before grab data.



            $collection->getSelect()->limit(1)


            or



            $collection->setPageSize(1, 1)



            Expamples:



            Collection with 750 products ...



            Without limiting before:



            • Total Incl. Wall Time (microsec): 2,116,522 microsecs

            • Total Incl. CPU (microsecs): 2,101,688 microsecs

            • Total Incl. MemUse (bytes): 4,783,504 bytes

            • Total Incl. PeakMemUse (bytes): 4,363,112 bytes

            • Number of Function Calls: 104,187

            With using getSelect()->limit(1):



            • Total Incl. Wall Time (microsec): 149,803 microsecs

            • Total Incl. CPU (microsecs): 131,405 microsecs

            • Total Incl. MemUse (bytes): 2,384,840 bytes

            • Total Incl. PeakMemUse (bytes): 1,827,112 bytes

            • Number of Function Calls: 5,327

            With using setPageSize(1, 1)



            • Total Incl. Wall Time (microsec): 155,025 microsecs

            • Total Incl. CPU (microsecs): 136,191 microsecs

            • Total Incl. MemUse (bytes): 2,413,128 bytes

            • Total Incl. PeakMemUse (bytes): 1,856,064 bytes

            • Number of Function Calls: 5,515

            Note:



            This warning will still pop up, even if you limit your collection before. To get rid of this message use $collection->getLastItem() instead.






            share|improve this answer















            GetFirstItem



            getFirstItem() does not limit the result of collection load to one item.



            incorrect:



            $collection = Mage::getModel('catalog/category')
            ->load(41)
            ->getProductCollection()
            ->addAttributeToSelect('weight');

            $product = $collection->getFirstItem();
            $weight = $product->getData('weight');


            correct:



            Apply limit before grab data.



            $collection->getSelect()->limit(1)


            or



            $collection->setPageSize(1, 1)



            Expamples:



            Collection with 750 products ...



            Without limiting before:



            • Total Incl. Wall Time (microsec): 2,116,522 microsecs

            • Total Incl. CPU (microsecs): 2,101,688 microsecs

            • Total Incl. MemUse (bytes): 4,783,504 bytes

            • Total Incl. PeakMemUse (bytes): 4,363,112 bytes

            • Number of Function Calls: 104,187

            With using getSelect()->limit(1):



            • Total Incl. Wall Time (microsec): 149,803 microsecs

            • Total Incl. CPU (microsecs): 131,405 microsecs

            • Total Incl. MemUse (bytes): 2,384,840 bytes

            • Total Incl. PeakMemUse (bytes): 1,827,112 bytes

            • Number of Function Calls: 5,327

            With using setPageSize(1, 1)



            • Total Incl. Wall Time (microsec): 155,025 microsecs

            • Total Incl. CPU (microsecs): 136,191 microsecs

            • Total Incl. MemUse (bytes): 2,413,128 bytes

            • Total Incl. PeakMemUse (bytes): 1,856,064 bytes

            • Number of Function Calls: 5,515

            Note:



            This warning will still pop up, even if you limit your collection before. To get rid of this message use $collection->getLastItem() instead.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Jun 16 '17 at 0:58


























            community wiki





            3 revs
            sv3n













            • I am getting Data access method LIMIT detected outside of Resource Model when using limit`

              – Amit Patel
              Dec 12 '17 at 8:10






            • 1





              Here is more details

              – Amit Patel
              Dec 12 '17 at 10:35

















            • I am getting Data access method LIMIT detected outside of Resource Model when using limit`

              – Amit Patel
              Dec 12 '17 at 8:10






            • 1





              Here is more details

              – Amit Patel
              Dec 12 '17 at 10:35
















            I am getting Data access method LIMIT detected outside of Resource Model when using limit`

            – Amit Patel
            Dec 12 '17 at 8:10





            I am getting Data access method LIMIT detected outside of Resource Model when using limit`

            – Amit Patel
            Dec 12 '17 at 8:10




            1




            1





            Here is more details

            – Amit Patel
            Dec 12 '17 at 10:35





            Here is more details

            – Amit Patel
            Dec 12 '17 at 10:35











            5














            Forbidden Function



            curl_xyz



            The use of function curl_init(), curl_setopt(), curl_exec(), curl_close() is forbidden



            incorrect:



            $ch = curl_init();
            curl_setopt($connection, CURLOPT_HTTPHEADER, $header);
            curl_setopt($connection, CURLOPT_POSTFIELDS, $request);
            curl_setopt($connection, CURLOPT_URL, $url);
            $response = curl_exec($ch);
            curl_close($ch);


            correct:



            $options = array(
            CURLOPT_HTTPHEADER => $header,
            CURLOPT_POSTFIELDS => $request
            );

            $curl = new Varien_Http_Adapter_Curl();
            $curl->setOptions($options);
            $curl->write(Zend_Http_Client::GET, $url, Zend_Http_Client::HTTP_0);
            $response = $curl->read();
            $responseBody = Zend_Http_Response::extractBody($response);
            $curl->close();





            share|improve this answer

























            • I used above code and it is giving me error Uncaught Error: Class 'CustomRmaHelperVarien_Http_Adapter_Curl' not found. How to use the class i found it in vendor but no luck.

              – Nitin Pawar
              Mar 5 '18 at 8:59












            • @NitinPawar can you please open a new question? Something seems to be wrong with your code.

              – sv3n
              Mar 5 '18 at 9:01















            5














            Forbidden Function



            curl_xyz



            The use of function curl_init(), curl_setopt(), curl_exec(), curl_close() is forbidden



            incorrect:



            $ch = curl_init();
            curl_setopt($connection, CURLOPT_HTTPHEADER, $header);
            curl_setopt($connection, CURLOPT_POSTFIELDS, $request);
            curl_setopt($connection, CURLOPT_URL, $url);
            $response = curl_exec($ch);
            curl_close($ch);


            correct:



            $options = array(
            CURLOPT_HTTPHEADER => $header,
            CURLOPT_POSTFIELDS => $request
            );

            $curl = new Varien_Http_Adapter_Curl();
            $curl->setOptions($options);
            $curl->write(Zend_Http_Client::GET, $url, Zend_Http_Client::HTTP_0);
            $response = $curl->read();
            $responseBody = Zend_Http_Response::extractBody($response);
            $curl->close();





            share|improve this answer

























            • I used above code and it is giving me error Uncaught Error: Class 'CustomRmaHelperVarien_Http_Adapter_Curl' not found. How to use the class i found it in vendor but no luck.

              – Nitin Pawar
              Mar 5 '18 at 8:59












            • @NitinPawar can you please open a new question? Something seems to be wrong with your code.

              – sv3n
              Mar 5 '18 at 9:01













            5












            5








            5







            Forbidden Function



            curl_xyz



            The use of function curl_init(), curl_setopt(), curl_exec(), curl_close() is forbidden



            incorrect:



            $ch = curl_init();
            curl_setopt($connection, CURLOPT_HTTPHEADER, $header);
            curl_setopt($connection, CURLOPT_POSTFIELDS, $request);
            curl_setopt($connection, CURLOPT_URL, $url);
            $response = curl_exec($ch);
            curl_close($ch);


            correct:



            $options = array(
            CURLOPT_HTTPHEADER => $header,
            CURLOPT_POSTFIELDS => $request
            );

            $curl = new Varien_Http_Adapter_Curl();
            $curl->setOptions($options);
            $curl->write(Zend_Http_Client::GET, $url, Zend_Http_Client::HTTP_0);
            $response = $curl->read();
            $responseBody = Zend_Http_Response::extractBody($response);
            $curl->close();





            share|improve this answer















            Forbidden Function



            curl_xyz



            The use of function curl_init(), curl_setopt(), curl_exec(), curl_close() is forbidden



            incorrect:



            $ch = curl_init();
            curl_setopt($connection, CURLOPT_HTTPHEADER, $header);
            curl_setopt($connection, CURLOPT_POSTFIELDS, $request);
            curl_setopt($connection, CURLOPT_URL, $url);
            $response = curl_exec($ch);
            curl_close($ch);


            correct:



            $options = array(
            CURLOPT_HTTPHEADER => $header,
            CURLOPT_POSTFIELDS => $request
            );

            $curl = new Varien_Http_Adapter_Curl();
            $curl->setOptions($options);
            $curl->write(Zend_Http_Client::GET, $url, Zend_Http_Client::HTTP_0);
            $response = $curl->read();
            $responseBody = Zend_Http_Response::extractBody($response);
            $curl->close();






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited 27 mins ago


























            community wiki





            6 revs, 2 users 97%
            sv3n













            • I used above code and it is giving me error Uncaught Error: Class 'CustomRmaHelperVarien_Http_Adapter_Curl' not found. How to use the class i found it in vendor but no luck.

              – Nitin Pawar
              Mar 5 '18 at 8:59












            • @NitinPawar can you please open a new question? Something seems to be wrong with your code.

              – sv3n
              Mar 5 '18 at 9:01

















            • I used above code and it is giving me error Uncaught Error: Class 'CustomRmaHelperVarien_Http_Adapter_Curl' not found. How to use the class i found it in vendor but no luck.

              – Nitin Pawar
              Mar 5 '18 at 8:59












            • @NitinPawar can you please open a new question? Something seems to be wrong with your code.

              – sv3n
              Mar 5 '18 at 9:01
















            I used above code and it is giving me error Uncaught Error: Class 'CustomRmaHelperVarien_Http_Adapter_Curl' not found. How to use the class i found it in vendor but no luck.

            – Nitin Pawar
            Mar 5 '18 at 8:59






            I used above code and it is giving me error Uncaught Error: Class 'CustomRmaHelperVarien_Http_Adapter_Curl' not found. How to use the class i found it in vendor but no luck.

            – Nitin Pawar
            Mar 5 '18 at 8:59














            @NitinPawar can you please open a new question? Something seems to be wrong with your code.

            – sv3n
            Mar 5 '18 at 9:01





            @NitinPawar can you please open a new question? Something seems to be wrong with your code.

            – sv3n
            Mar 5 '18 at 9:01

















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f178640%2fecg-compliance-how-to-do%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            یوتیوب محتویات پیشینه[ویرایش] فناوری‌های ویدئویی[ویرایش] شوخی‌های آوریل[ویرایش] سانسور و فیلترینگ[ویرایش] آمار و ارقامی از یوتیوب[ویرایش] تأثیر اجتماعی[ویرایش] سیاست اجتماعی[ویرایش] نمودارها[ویرایش] یادداشت‌ها[ویرایش] پانویس[ویرایش] پیوند به بیرون[ویرایش] منوی ناوبریبررسی شده‌استYouTube.com[بروزرسانی]"Youtube.com Site Info""زبان‌های یوتیوب""Surprise! There's a third YouTube co-founder"سایت یوتیوب برای چندمین بار در ایران فیلتر شدنسخهٔ اصلیسالار کمانگر جوان آمریکایی ایرانی الاصل مدیر سایت یوتیوب شدنسخهٔ اصلیVideo websites pop up, invite postingsthe originalthe originalYouTube: Overnight success has sparked a backlashthe original"Me at the zoo"YouTube serves up 100 million videos a day onlinethe originalcomScore Releases May 2010 U.S. Online Video Rankingsthe originalYouTube hits 4 billion daily video viewsthe originalYouTube users uploading two days of video every minutethe originalEric Schmidt, Princeton Colloquium on Public & Int'l Affairsthe original«Streaming Dreams»نسخهٔ اصلیAlexa Traffic Rank for YouTube (three month average)the originalHelp! YouTube is killing my business!the originalUtube sues YouTubethe originalGoogle closes $A2b YouTube dealthe originalFlash moves on to smart phonesthe originalYouTube HTML5 Video Playerنسخهٔ اصلیYouTube HTML5 Video Playerthe originalGoogle tries freeing Web video with WebMthe originalVideo length for uploadingthe originalYouTube caps video lengths to reduce infringementthe originalAccount Types: Longer videosthe originalYouTube bumps video limit to 15 minutesthe originalUploading large files and resumable uploadingthe originalVideo Formats: File formatsthe originalGetting Started: File formatsthe originalThe quest for a new video codec in Flash 8the originalAdobe Flash Video File Format Specification Version 10.1the originalYouTube Mobile goes livethe originalYouTube videos go HD with a simple hackthe originalYouTube now supports 4k-resolution videosthe originalYouTube to get high-def 1080p playerthe original«Approximate YouTube Bitrates»نسخهٔ اصلی«Bigger and Better: Encoding for YouTube 720p HD»نسخهٔ اصلی«YouTube's 1080p – Failure Depends on How You Look At It»نسخهٔ اصلیYouTube in 3Dthe originalYouTube in 3D?the originalYouTube 3D Videosthe originalYouTube adds a dimension, 3D goggles not includedthe originalYouTube Adds Stereoscopic 3D Video Support (And 3D Vision Support, Too)the original«Sharing YouTube Videos»نسخهٔ اصلی«Downloading videos from YouTube is not supported, except for one instance when it is permitted.»نسخهٔ اصلی«Terms of Use, 5.B»نسخهٔ اصلی«Some YouTube videos get download option»نسخهٔ اصلی«YouTube looks out for content owners, disables video ripping»«Downloading videos from YouTube is not supported, except for one instance when it is permitted.»نسخهٔ اصلی«YouTube Hopes To Boost Revenue With Video Downloads»نسخهٔ اصلی«YouTube Mobile»نسخهٔ اصلی«YouTube Live on Apple TV Today; Coming to iPhone on June 29»نسخهٔ اصلی«Goodbye Flash: YouTube mobile goes HTML5 on iPhone and Android»نسخهٔ اصلی«YouTube Mobile Goes HTML5, Video Quality Beats Native Apps Hands Down»نسخهٔ اصلی«TiVo Getting YouTube Streaming Today»نسخهٔ اصلی«YouTube video comes to Wii and PlayStation 3 game consoles»نسخهٔ اصلی«Coming Up Next... YouTube on Your TV»نسخهٔ اصلی«Experience YouTube XL on the Big Screen»نسخهٔ اصلی«Xbox Live Getting Live TV, YouTube & Bing Voice Search»نسخهٔ اصلی«YouTube content locations»نسخهٔ اصلی«April fools: YouTube turns the world up-side-down»نسخهٔ اصلی«YouTube goes back to 1911 for April Fools' Day»نسخهٔ اصلی«Simon Cowell's bromance, the self-driving Nascar and Hungry Hippos for iPad... the best April Fools' gags»نسخهٔ اصلی"YouTube Announces It Will Shut Down""YouTube Adds Darude 'Sandstorm' Button To Its Videos For April Fools' Day"«Censorship fears rise as Iran blocks access to top websites»نسخهٔ اصلی«China 'blocks YouTube video site'»نسخهٔ اصلی«YouTube shut down in Morocco»نسخهٔ اصلی«Thailand blocks access to YouTube»نسخهٔ اصلی«Ban on YouTube lifted after deal»نسخهٔ اصلی«Google's Gatekeepers»نسخهٔ اصلی«Turkey goes into battle with Google»نسخهٔ اصلی«Turkey lifts two-year ban on YouTube»نسخهٔ اصلیسانسور در ترکیه به یوتیوب رسیدلغو فیلترینگ یوتیوب در ترکیه«Pakistan blocks YouTube website»نسخهٔ اصلی«Pakistan lifts the ban on YouTube»نسخهٔ اصلی«Pakistan blocks access to YouTube in internet crackdown»نسخهٔ اصلی«Watchdog urges Libya to stop blocking websites»نسخهٔ اصلی«YouTube»نسخهٔ اصلی«Due to abuses of religion, customs Emirates, YouTube is blocked in the UAE»نسخهٔ اصلی«Google Conquered The Web - An Ultimate Winner»نسخهٔ اصلی«100 million videos are viewed daily on YouTube»نسخهٔ اصلی«Harry and Charlie Davies-Carr: Web gets taste for biting baby»نسخهٔ اصلی«Meet YouTube's 224 million girl, Natalie Tran»نسخهٔ اصلی«YouTube to Double Down on Its 'Channel' Experiment»نسخهٔ اصلی«13 Some Media Companies Choose to Profit From Pirated YouTube Clips»نسخهٔ اصلی«Irate HK man unlikely Web hero»نسخهٔ اصلی«Web Guitar Wizard Revealed at Last»نسخهٔ اصلی«Charlie bit my finger – again!»نسخهٔ اصلی«Lowered Expectations: Web Redefines 'Quality'»نسخهٔ اصلی«YouTube's 50 Greatest Viral Videos»نسخهٔ اصلیYouTube Community Guidelinesthe original«Why did my YouTube account get closed down?»نسخهٔ اصلی«Why do I have a sanction on my account?»نسخهٔ اصلی«Is YouTube's three-strike rule fair to users?»نسخهٔ اصلی«Viacom will sue YouTube for $1bn»نسخهٔ اصلی«Mediaset Files EUR500 Million Suit Vs Google's YouTube»نسخهٔ اصلی«Premier League to take action against YouTube»نسخهٔ اصلی«YouTube law fight 'threatens net'»نسخهٔ اصلی«Google must divulge YouTube log»نسخهٔ اصلی«Google Told to Turn Over User Data of YouTube»نسخهٔ اصلی«US judge tosses out Viacom copyright suit against YouTube»نسخهٔ اصلی«Google and Viacom: YouTube copyright lawsuit back on»نسخهٔ اصلی«Woman can sue over YouTube clip de-posting»نسخهٔ اصلی«YouTube loses court battle over music clips»نسخهٔ اصلیYouTube to Test Software To Ease Licensing Fightsthe original«Press Statistics»نسخهٔ اصلی«Testing YouTube's Audio Content ID System»نسخهٔ اصلی«Content ID disputes»نسخهٔ اصلیYouTube Community Guidelinesthe originalYouTube criticized in Germany over anti-Semitic Nazi videosthe originalFury as YouTube carries sick Hillsboro video insultthe originalYouTube attacked by MPs over sex and violence footagethe originalAl-Awlaki's YouTube Videos Targeted by Rep. Weinerthe originalYouTube Withdraws Cleric's Videosthe originalYouTube is letting users decide on terrorism-related videosthe original«Time's Person of the Year: You»نسخهٔ اصلی«Our top 10 funniest YouTube comments – what are yours?»نسخهٔ اصلی«YouTube's worst comments blocked by filter»نسخهٔ اصلی«Site Info YouTube»نسخهٔ اصلیوبگاه YouTubeوبگاه موبایل YouTubeوووووو

            Magento 2 - Auto login with specific URL Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Customer can't login - Page refreshes but nothing happensCustom Login page redirectURL to login with redirect URL after completionCustomer login is case sensitiveLogin with phone number or email address - Magento 1.9Magento 2: Set Customer Account Confirmation StatusCustomer auto connect from URLHow to call customer login form in the custom module action magento 2?Change of customer login error message magento2Referrer URL in modal login form

            Rest API with Magento using PHP with example. Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?How to update product using magento client library for PHP?Oauth Error while extending Magento Rest APINot showing my custom api in wsdl(url) and web service list?Using Magento API(REST) via IXMLHTTPRequest COM ObjectHow to login in Magento website using REST APIREST api call for Guest userMagento API calling using HTML and javascriptUse API rest media management by storeView code (admin)Magento REST API Example ErrorsHow to log all rest api calls in magento2?How to update product using magento client library for PHP?