Support » Plugin: Theme Check » Missing a text-domain

  • Junaid Raza

    (@junaidraza)


    Could you tell us about required fix please

    <?php
    	
    				$estimated_text = WC()->customer->is_customer_outside_base() && ! WC()->customer->has_calculated_shipping()
    					? sprintf( ' ' . __( ' (taxes estimated for %s)', 'theme-name' ), WC()->countries->estimated_for_prefix() . __( WC()->countries->countries[ WC()->countries->get_base_country() ], 'theme-name' ) )
    					: '';
    	
    				printf( __( 'Note: Shipping and taxes are estimated%s and will be updated during checkout based on your billing and shipping information.', 'theme-name' ), $estimated_text );
    	
    			?>

    getting the following error

    Found a translation function that is missing a text-domain. Function __, with the arguments

    2nd

    fopen was found in the file subscribe_save.php File operations should use the WP_Filesystem methods instead of direct PHP filesystem calls.

    $fp = fopen('subscribers.csv', 'w');
    what would be the correct line ?

    fclose was found in the file subscribe_save.php File operations should use the WP_Filesystem methods instead of direct PHP filesystem calls

    fclose($fp);

    last but not least ” The theme uses the add_shortcode() function. Custom post-content shortcodes are plugin-territory functionality.”

    we are using add_shortcode() through out the theme any solution to fix this issue ?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Junaid Raza

    (@junaidraza)

    we were able to fix this text-domain error

    <?php
    	
    				$estimated_text = WC()->customer->is_customer_outside_base() && ! WC()->customer->has_calculated_shipping()
    					? sprintf( ' ' . __( ' (taxes estimated for %s)', 'theme-name' ), WC()->countries->estimated_for_prefix() . __( WC()->countries->countries[ WC()->countries->get_base_country() ], 'country', 'theme-name' ) )
    					: '';
    	
    				printf( __( 'Note: Shipping and taxes are estimated%s and will be updated during checkout based on your billing and shipping information.', 'theme-name' ), $estimated_text );
    	
    			?>

    though still seeking for help for other two

    Junaid Raza

    (@junaidraza)

    Rest all issues have been resolved now looking for assistance with following issue only

    “The theme uses the add_shortcode() function. Custom post-content shortcodes are plugin-territory functionality.”

    Ulrich

    (@grapplerulrich)

    WordPress Contributor

    You need to remove the function add_shortcode() to resolve that issue.

    Junaid Raza

    (@junaidraza)

    do we have to create separate plugin for custom post type or there is any alternative available to insert custom post type in WP theme?

    Ulrich

    (@grapplerulrich)

    WordPress Contributor

    No, you can use an existing plugin to support a certain feature. Custom Post Types are not allowed in a theme.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.