PageForge 1.3: Verifique todas as corridas antes de escrever, atualize as páginas geradas, SpinTax e lotes reumáveis. Veja o que mudou
Safe Function Call icon
Desacelerando Testado até 6.8.13 #21 in coffee2code

Safe Function Call

Safely and easily call functions that may not be available (such as those provided by a plugin that gets deactivated)

Instalações ativas10+10+ nível
Downloads · 30d153▲ 3.1× vs prev. 30d
Classificação5/51 comentários
Pontuação da saúde39/100Em risco
Downloads de todos os tempos5.3KSince Jun 2009
Suporte resolvido—Sem tópicos recentes
RequerWP 1.5Php qualquer
Downloads · 7d15• 0% semana a semana
Nosso veredicto

Considere uma alternativa

Safe Function Call shows warning signs in 2026 — compare the alternatives below before installing. It runs on 10+ sites, is rated 5/5 and was last updated 2 years ago, and scores 39/100 on our health check.

  • Pequena base de usuários (10+ instalações ativas)
  • Muito poucos comentários até agora
  • Nenhuma atualização em mais de um ano
  • Testado apenas até WordPress 6.8 (mais recente é 7.1)

Como ele se acumula?

Lado a lado em instalações, atualizações, avaliações e suporte

Downloads diários

81726Aug 25Oct 8Nov 22
Ontem3
Média diária (1y)2
Dia de pico358 de novembro de 2026
Últimos 12 meses645

Os picos de download geralmente seguem uma nova versão — cada site que atualiza automaticamente é um download.

Rankings

Where Safe Function Call stands today

WordPress.org Classificações de pesquisa

Posição ao vivo na pesquisa de plugins, top 100
Palavra chavePosiçãoPlugins concorrentesCategoria
coffee2code #18 65 Best coffee2code plugins →
erro >100 10,000 Melhores plugins de erro →
function >100 10,000 Best function plugins →
template >100 10,000 Best template plugins →

Adoção da versão

Compartilhamento de sites ativos por lançamento.

  • 1.2100.0%

Divisão de classificação

★★★★★ ★★★★★ 5 de 1 comentários

  • 5★100.0%
  • 4★0.00%
  • 3★0.00%
  • 2★0.00%
  • 1★0.00%

About Safe Function Call

From the official readme · v1.4

Descrição

Safely call a function, class method, or object method in a manner that doesn’t generate errors if those plugins cease to exist.

Various helper functions are provided that provide handy variations of this theme:

  • _sfc(): Safely call a function and get its return value
  • _sfce(): Safely call a function and echo its return value
  • _sfcf(): Safely call a function; if it doesn’t exist, then a fallback function (if specified) is called
  • _sfcm(): Safely call a function; if it doesn’t exist, then echo a message (if provided)

Let’s assume you had something like this in a template:

<?php list_cities( 'Texas', 3 ); ?>

If you deactivated the plugin that provided list_cities(), your site would generate an error when that template is accessed.

You can instead use _sfc(), which is provided by this plugin to call other functions, like so:

<?php _sfc( 'list_cities', 'Texas', 3 ); ?>

That will simply do nothing if the list_cities() function is not available.

If you’d rather display a message when the function does not exist, use _sfcm() instead, like so:

<?php _sfcm( 'list_cities', 'The cities listing is temporarily disabled.', 'Texas', 3 ); ?>

In this case, if list_cities() is not available, the text “The cities listing is temporarily disabled.” will be displayed.

If you’d rather call another function when the function does not exist, use _sfcf() instead, like so:

<?php
    function unavailable_function_handler( $function_name ) { echo "The function $function_name is not available."; }
    _sfcf( 'nonexistent_function', 'unavailable_function_handler' );
?>

In the event you want to safely call a function and echo its value, you can use _sfce() like so:

<?php _sfce( 'largest_city', 'Tx' ); ?>

Which is roughly equivalent to doing :

<?php if function_exists( 'largest_city' ) { echo largest_city( 'Tx' ); } ?>

Filter invocation method

To further prevent issues in your code should this plugin itself become deactivated, you can use indirect filter invocation to call the plugin functions. Each function has an associated filter with the same name as the function. Simply use apply_filters() to invoke that function instead of calling the function directly.

E.g. instead of:

<?php _sfce( 'some_plugin_function_that_echoes', 'argument' ); ?>

Do:

<?php apply_filters( '_sfce', 'some_plugin_function_that_echoes', 'argument' ); ?>

If you’re relying on the return value of a function and this plugin gets deactivated, note that the apply_filters() call will return the name of the function you intended to call, so you should check the return value to ensure the function got called.

Instead of:

<?php $x = _sfc( 'some_plugin_function', 'argument' ); ?>

Do:

<?php
    $x = apply_filters( '_sfcq', 'some_plugin_function', 'argument' );
    if ( $x !== 'some_plugin_function' ) {
        // Work with the value of $x here.
    } else {
        // The Safe Function Call plugin isn't active.
        $x = 0; // Maybe set the variable to something that makes sense in this scenario.
    }
?>

Links: Plugin Homepage | Plugin Directory Page | GitHub | Author Homepage

Developer Documentation

Developer documentation can be found in DEVELOPER-DOCS.md. That documentation covers the template tags and hooks provided by the plugin.

As an overview, these are the template tags provided by the plugin:

  • _sfc() : Safely call a function and get its return value.
  • _sfce() : Safely call a function and echo its sanitized return value.
  • _sfcf() : Safely call a function; if it doesn’t exist, then a fallback function (if specified) is called.
  • _sfcm() : Safely call a function; if it doesn’t exist, then echo a message (if provided).

These are the hooks provided by the plugin. They are intended for filter invocation usage rather than typical content filtering.

  • _sfc : Filter to safely invoke _sfc() in such a way that if the plugin were deactivated or deleted, then your calls to the function won’t cause errors in your site.
  • _sfce : Filter to safely invoke _sfce() in such a way that if the plugin were deactivated or deleted, then your calls to the function won’t cause errors in your site.
  • _sfcf : Filter to safely invoke _sfcf() in such a way that if the plugin were deactivated or deleted, then your calls to the function won’t cause errors in your site.
  • _sfcm : Filter to safely invoke _sfcm() in such a way that if the plugin were deactivated or deleted, then your calls to the function won’t cause errors in your site.

Instalação

  1. Install via the built-in WordPress plugin installer. Or download and unzip safe-function-call.zip inside the plugins directory for your site (typically wp-content/plugins/)
  2. Activate the plugin through the ‘Plugins’ admin menu in WordPress
  3. Use any of the four functions provided by this plugin as desired

Log de Changes

Minor update: sanitized the output of the callback return value in _sfce() and the $msg_if_missing argument value to _sfce(), noted compatibility through WP 6.8+ and PHP 8.3+, and updated copyright date (2025).

1.4 (2025-04-09)

Highlights:

This minor release sanitizes the output of the callback return value in _sfce() and the $msg_if_missing argument value to _sfce(), notes compatibility through WP 6.8+ and PHP 8.3+, and updates copyright date (2025).

Details:

  • Hardening: Sanitize output of callback return value in _sfce()
  • Hardening: Sanitize output of $msg_if_missing argument value to _sfcm()
  • Change: Note compatibility through WP 6.8+
  • Change: Note compatibility through PHP 8.3+
  • Change: Update copyright date (2025)

1.3.3 (2024-08-09)

  • Change: Note compatibility through WP 6.6+
  • Change: Update copyright date (2024)
  • New: Add .gitignore file
  • Change: Remove development and testing-related files from release packaging
  • Unit tests:
    • Hardening: Prevent direct web access to bootstrap.php
    • Allow tests to run against current versions of WordPress
    • New: Add composer.json for PHPUnit Polyfill dependency
    • Change: In bootstrap, store path to plugin directory in a constant

1.3.2 (2023-05-19)

  • New: Add DEVELOPER-DOCS.md and move hooks documentation into it
  • New: Add TODO.md with potential TODO items
  • Change: Improve some inline documentation formatting
  • Change: Note compatibility through WP 6.3+
  • Change: Update copyright date (2023)

1.3.1 (2021-09-26)

  • Change: Note compatibility through WP 5.8+
  • Unit tests:
    • Change: Restructure unit test directories
      • Change: Move phpunit/bin/ into tests/
      • Change: Move phpunit/ into tests/
    • Change: Remove ‘test-‘ prefix from unit test file
    • Change: In bootstrap, store path to plugin file constant
    • Change: In bootstrap, add backcompat for PHPUnit pre-v6.0

Full changelog is available in CHANGELOG.md.

Registro de change completo em WordPress.org →

Para desenvolvedores

Este é o seu plugin? Mostre os números.

Adicione um crachá ao vivo ao seu site, Documentos ou Readme do GitHub. Ele é atualizado por conta própria - nenhuma conta necessária.

Selo de Instalações Ativas Selo de classificação Distintivo de pontuação de saúde

Best Safe Function Call alternatives

All coffee2code plugins →
Alternativas
Classificação Plugin Instalações ativas Classificação Atualizada Saúde
1 Desative a pesquisa Desative a pesquisa Desative os recursos de pesquisa front-end integrados de WordPress. Por Scott Reilly 30K+ ★★★★★★★★★★ 4.7 (16) 2 anos atrás 51
2 Configure SMTP Configure SMTP Configure SMTP mailing in WordPress, including support for sending email via SSL/TLS (such… Por Scott Reilly 6K+ ★★★★★★★★★★ 4.9 (45) 2 anos atrás 46
3 Um clique Fechar Comentários Um clique Fechar Comentários Feche ou abra os comentários convenientemente para uma postagem ou página com um clique do administrador… Por Scott Reilly 5K+ ★★★★★★★★★★ 4.9 (10) 2 anos atrás 50
4 Text Replace Text Replace Replace text with other text. Handy for creating shortcuts to common, lengthy, or… Por Scott Reilly 3K+ ★★★★★★★★★★ 4.4 (18) 5 anos atrás 38
5 Duplicate Widget Duplicate Widget A widget that can act as a duplicate of another widget (for synchronized use in another… Por Scott Reilly 1K+ ★★★★★★★★★★ 4.3 (12) 9 anos atrás 36
6 Force Admin Color Scheme Force Admin Color Scheme Force a single admin color scheme for all users of the site. Por Scott Reilly 500+ ★★★★★★★★★★ 5 (2) 2 anos atrás 43
7 Single Category Permalink Single Category Permalink Reduce permalinks (category or post) that include entire hierarchy of categories to just… Por Scott Reilly 400+ ★★★★★★★★★★ 5 (5) 5 anos atrás 39
8 Hide Broken Shortcodes Hide Broken Shortcodes Prevent broken shortcodes from appearing in posts and pages. Por Scott Reilly 400+ ★★★★★★★★★★ 4.5 (10) 7 meses atrás 52
9 Years Ago Today Years Ago Today Lists posts published to your site on this day in previous years via admin dashboard… Por Scott Reilly 100+ ★★★★★★★★★★ 5 (6) 6 meses atrás 65
10 Disable Directory Listings Disable Directory Listings Prevent virtual directory listing services from listing the contents of directories, and/or… Por Scott Reilly 90+ ★★★★★★★★★★ 5 (1) 15 anos atrás 32

FAQ

Safe Function Call: quick answers

Respostas diretas, extraídas de dados ao vivo WordPress.org.

Fonte: WordPress.org

Is Safe Function Call free?

Yes. Safe Function Call is free to download and use from the official WordPress.org plugin directory.

Is Safe Function Call safe to use in 2026?

Safe Function Call shows warning signs in 2026 — compare the alternatives below before installing. It runs on 10+ sites, is rated 5/5 and was last updated 2 years ago, and scores 39/100 on our health check.

How many websites use Safe Function Call?

Safe Function Call is active on 10+ WordPress websites and has been downloaded 5,326 times since it launched in June 2009. It was downloaded 153 times in the last 30 days.

Does Safe Function Call work with WordPress 7.1?

Safe Function Call is officially tested up to WordPress 6.8.13, while the latest release is 7.1.5. It may still work, but try it on a staging site first.

When was Safe Function Call last updated?

The latest version, 1.4, was released on April 14, 2025 (2 years ago).

Who makes Safe Function Call?

Safe Function Call is developed and maintained by Scott Reilly.

What are the best alternatives to Safe Function Call?

The most popular alternatives to Safe Function Call are Disable Search (30K+ installs), Configure SMTP (6K+ installs) and One Click Close Comments (5K+ installs).

Alimentado por PageForge

Um modelo e uma planilha. Uma página real para cada pesquisa.

PageForge Transforma cada linha de um CSV em uma página WordPress com seu próprio título, URL, SEO campos e esquema, construído no layout que você já desenhou. Gratuito em WordPress.org.

  • CSV e XLSX, mais Google Sheets em Profissional e Empresarial
  • Seu próprio título, URL, SEO campos e esquema para cada página
  • Funciona com o editor de blocos, Elementor, Divi e Avada
  • Gratuito em WordPress.org, sem cartão de crédito

↑↓ mover↵ abrir